Yaco-Sistemas/peer — pull request #11 by johanlundberg (2013-04-05 13:42:57+00:00)
Title: TOU files are now read as UTF-8 encoded files

As specified in the documentation:
In both cases a legal text should be presented to the user in order to prevent future complications. These text must be stored in UTF-8 encoded text files ...

This previously generated this error:
ERROR 2013-04-05 08:14:28,753 base 25659 140232420706048 Internal Server Error:
/entity/8/edit_metadata/
Traceback (most recent call last):
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/co
re/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/co
ntrib/auth/decorators.py", line 20, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/var/www/peer/lib/python2.6/site-packages/peer-0.10.1-py2.6.egg/peer/ent
ity/views/metadata.py", line 167, in edit_metadata
form=file_form),
File "/var/www/peer/lib/python2.6/site-packages/peer-0.10.1-py2.6.egg/peer/ent
ity/views/metadata.py", line 75, in _get_edit_metadata_form
}, context_instance=context_instance)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/loader.py", line 176, in render_to_string
return t.render(context_instance)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 140, in render
return self._render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 837, in render_node
return node.render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/loader_tags.py", line 53, in render
result = self.nodelist.render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 837, in render_node
return node.render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/defaulttags.py", line 192, in render
nodelist.append(node.render(context))
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/defaulttags.py", line 281, in render
return nodelist.render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 837, in render_node
return node.render(context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 880, in render
return _render_value_in_context(output, context)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/base.py", line 858, in _render_value_in_context
value = force_unicode(value)
File "/var/www/peer/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/utils/encoding.py", line 93, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128). You passed in ()