Bug 7197 - Searching the builds table crashes toaster
Summary: Searching the builds table crashes toaster
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 1.8 M3
Assignee: Alexandru Damian
QA Contact: Mihail Stanciu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-01-20 12:21 UTC by Mihail Stanciu
Modified: 2015-02-16 15:07 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Used to work)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
search error (99.72 KB, image/jpeg)
2015-01-20 12:21 UTC, Mihail Stanciu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihail Stanciu 2015-01-20 12:21:55 UTC
Created attachment 2342 [details]
search error

Tested on master: d9d5b8b499af3ae01a1e33d0d3969c54c2d4ab1b

Steps to reproduce:
1. Start toaster
2. Create a new image (core-image-minimal)
3. In the "All Builds" table type a search term in the search bar click the search button.

Expected result:
Search pattern applies to table rows.

Observed result:
Application fails with django error. See screenshot.
Comment 1 Mihail Stanciu 2015-01-20 12:22:19 UTC
Traceback:

Environment:


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

Django Version: 1.5
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
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/dave/poky/bitbake/lib/toaster/toastergui/views.py" in builds
  1737.         queryset_with_search = _get_queryset(BuildRequest, queryset_all, None, search_term, ordering_string, '-updated')
File "/home/dave/poky/bitbake/lib/toaster/toastergui/views.py" in _get_queryset
  224.         queryset = _get_search_results(search_term, queryset, model)
File "/home/dave/poky/bitbake/lib/toaster/toastergui/views.py" in _get_search_results
  190.                 model.search_allowed_fields)

Exception Type: AttributeError at /toastergui/builds/
Exception Value: type object 'BuildRequest' has no attribute 'search_allowed_fields'
Comment 2 Alexandru Damian 2015-01-20 16:48:06 UTC
Fixed by patch pushed for review on poky-contrib:adamian/20150119-fixes

d0737fc7
bitbake: toaster: project builds page
    
    This is a complete re-write of the "Project builds" page
    based on the "All builds" page in managed mode.
    
    [YOCTO #6589]
Comment 3 Alexandru Damian 2015-02-10 13:29:44 UTC
Patch merged in master.
Comment 4 Mihail Stanciu 2015-02-16 15:07:14 UTC
Verified on master: 6ae933b75c1c34a9d39e1aff0a0cb26a7ce4677f