Room page's interface tab is blank in NAV 4.4.0

Bug #1535723 reported by Morten Brekkevold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
High
Morten Brekkevold

Bug Description

The room page's "Netbox interfaces" tab is always blank under NAV 4.44.0.

Using the developer console, it is apparent that the backend URL that is queried to get tab contents fails with a 500 error. The following traceback is reported:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/nav/web/info/room/views.py", line 258, in render_netboxes context_instance=RequestContext(request))
File "/usr/lib/python2.7/dist-packages/django/shortcuts.py", line 23, in render_to_response return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 178, in render_to_string return t.render(context_instance)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 148, in render return self._render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 142, in _render return self.nodelist.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 844, in render bit = self.render_node(node, context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 858, in render_node return node.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/defaulttags.py", line 208, in render nodelist.append(node.render(context))
File "/usr/lib/python2.7/dist-packages/django/template/defaulttags.py", line 208, in render nodelist.append(node.render(context))
File "/usr/lib/python2.7/dist-packages/django/template/defaulttags.py", line 312, in render return nodelist.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 844, in render bit = self.render_node(node, context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 858, in render_node return node.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/defaulttags.py", line 312, in render return nodelist.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 844, in render bit = self.render_node(node, context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 858, in render_node return node.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 898, in render output = self.filter_expression.resolve(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 624, in resolve new_obj = func(obj, *arg_vals)
File "/usr/lib/python2.7/dist-packages/nav/django/templatetags/info.py", line 55, in days_since get_stupid_space()):
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128)

Tags: django
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

This appears to be due to a maladaption to various Django versions in the nav.django.templatetags.info.days_since() function. It was committed at the same time as the time_since() function. The latter uses a unicode string format, the former does not. Under Django versions >= 1.6, this ultimately fails, since the value retrieved by the get_stupid_space() function is not ASCII-encodeable under Django >= 1.6.

This whole adaptation and the "get_stupid_space()" function should be wholly removed. It is useless as long as we have a specific requirement of django 1.7.

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
milestone: none → 4.4.1
status: Confirmed → Fix Committed
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Also, the page is not *always* blank. If no ports on the page are active "now", the error will not be triggered.

Changed in nav:
status: Fix Committed → Fix Released
summary: - Room page's interface tab is blank in NAV 4.0.0
+ Room page's interface tab is blank in NAV 4.4.0
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.