Bug 7618

Summary: Django admin interface for toaster not working
Product: [Build System, Metadata & Runtime] Toaster Reporter: Mihail Stanciu <stanciux.mihail>
Component: toasterAssignee: Ed Bartosh <eduard.bartosh>
Status: VERIFIED FIXED QA Contact: Cristina Agurida <cristina-danielax.agurida>
Severity: normal    
Priority: High CC: alexandru.damian, belen.barros.pena, cristiana.voicu, cristina-danielax.agurida, eduard.bartosh, jessica.zhang
Version: unspecified   
Target Milestone: 1.9 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 7246    

Description Mihail Stanciu 2015-04-16 12:42:05 UTC
Tested on master: 02881a8d0b9995f4f3c9904c06ae4b7882958591

Steps to reproduce:
1. Start Toaster in managed mode
2. Log in to the Django admin interface (http://localhost:8000/admin)
3. Click on "Toaster settings" at the bottom of the list

Expected:
Various administration options should become available to you.

Observed:
Page crashes with error. Traceback follows:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/admin/orm/toastersetting/

Django Version: 1.6
Python Version: 2.7.8
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')


Template error:
In template /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin/change_list.html, error at line 91
   not all arguments converted during string formatting
   81 :         {% endif %}


   82 :       {% endblock %}


   83 : 


   84 :       <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}


   85 :       {% if cl.formset %}


   86 :         <div>{{ cl.formset.management_form }}</div>


   87 :       {% endif %}


   88 : 


   89 :       {% block result_list %}


   90 :           {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}


   91 :            {% result_list cl %} 


   92 :           {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}


   93 :       {% endblock %}


   94 :       {% block pagination %}{% pagination cl %}{% endblock %}


   95 :       </form>


   96 :     </div>


   97 :   </div>


   98 : {% endblock %}


   99 : 

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  139.                 response = response.render()
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in render
  105.             self.content = self.rendered_content
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in rendered_content
  82.         content = template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  1196.                     _dict = func(*resolved_args, **resolved_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py" in result_list
  288.             'results': list(results(cl))}
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py" in results
  266.             yield ResultList(None, items_for_result(cl, res, None))
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py" in __init__
  258.         super(ResultList, self).__init__(*items)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py" in items_for_result
  185.             f, attr, value = lookup_field(field_name, result, cl.model_admin)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/util.py" in lookup_field
  258.                 value = attr()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in __str__
  430.             return force_text(self).encode('utf-8')
File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py" in force_text
  100.                 s = s.__unicode__()
File "/home/dave/poky/bitbake/lib/toaster/orm/models.py" in __unicode__
  55.         return "Setting %s = " % (self.name, self.value)

Exception Type: TypeError at /admin/orm/toastersetting/
Exception Value: not all arguments converted during string formatting
Comment 1 Ed Bartosh 2015-05-01 21:59:25 UTC
should be fixed by this https://lists.yoctoproject.org/pipermail/toaster/2015-May/002061.html
Comment 3 Cristina Agurida 2015-05-29 11:56:10 UTC
Verified on master: a05663bfa10352fd5af6ca9a9d7b323c1c099f35