Bug 7513

Summary: The date picker feature breaks the builds pages
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Alexandru Damian <alexandru.damian>
Status: VERIFIED FIXED QA Contact: Cristina Agurida <cristina-danielax.agurida>
Severity: normal    
Priority: Medium+ CC: alexandru.damian, belen.barros.pena, bogdanx.a.voiculescu, cristiana.voicu, cristina-danielax.agurida, jessica.zhang
Version: unspecified   
Target Milestone: 1.8 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Belen Barros Pena 2015-03-25 13:19:58 UTC
The error happens in both the project builds and the all builds pages. This is the traceback:

Environment:


Request Method: GET
Request URL:
http://127.0.0.1:8000/toastergui/builds/?count=10&orderby=completed_on%3A-&
page=1

Django Version: 1.6
Python Version: 2.7.6
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.staticfiles',
'django.contrib.humanize',
'orm',
'toastermain',
'south',
'bldcontrol',
'bldviewer',
'toastergui')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
in get_response
  114.                     response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/home/yocto/master/bitbake/lib/toaster/toastergui/views.py" in builds
  1879.             context, pagesize, orderby =
_build_list_helper(request, buildrequests, True)
File "/home/yocto/master/bitbake/lib/toaster/toastergui/views.py" in
_build_list_helper
  2017.         context_date,today_begin,yesterday_begin =
_add_daterange_context(queryset_all, request, {'created','updated'})
File "/home/yocto/master/bitbake/lib/toaster/toastergui/views.py" in
_add_daterange_context
  337.        
context_date['dateMin_'+key]=timezone.localtime(getattr(queryset_key.first(
),key)).strftime("%d/%m/%Y")

Exception Type: AttributeError at /toastergui/builds/
Exception Value: 'NoneType' object has no attribute 'updated'
Comment 1 Alexandru Damian 2015-03-25 13:40:56 UTC
Patch for review on 

poky-contrib:adamian/20150324_submission
Comment 2 Alexandru Damian 2015-04-07 13:23:51 UTC
Merged to master.
Comment 3 Cristina Agurida 2015-04-17 13:36:01 UTC
Verified on master: 547b189951283e1ea1fabd135d32bcb59124d8c3