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)
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.