UnboundLocalError
Opened this issue · 2 comments
Deleted user commented
I'm getting this error :UnboundLocalError at /comments/
local variable 'serializer' referenced before assignment and I don't know why. Here's the traceback:
Traceback:
File "/root/python/django-zack/local/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/core/handlers/base.py" in get_response
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/django/template/response.py" in render
response = response.render()
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/rest_framework/response.py" in rendered_content
self.content = self.rendered_content
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/rest_framework/renderers.py" in render
ret = renderer.render(self.data, media_type, context)
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/rest_framework/renderers.py" in get_context
context = self.get_context(data, accepted_media_type, renderer_context)
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/rest_framework/renderers.py" in get_raw_data_form
raw_data_post_form = self.get_raw_data_form(view, 'POST', request)
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/rest_framework/serializers.py" in data
content = renderer.render(serializer.data, accepted, context)
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/rest_framework/serializers.py" in to_native
self._data = self.to_native(obj)
-
File "/root/python/django-zack/local/lib/python2.7/site-packages/generic_relations/relations.py" in field_to_native
value = field.field_to_native(obj, field_name)
-
return serializer.to_native(value)
Exception Type: UnboundLocalError at /comments/
Exception Value: local variable 'serializer' referenced before assignment.
Does anyone else have this issue? If so how did you solve it?
LilyFoote commented
Sorry about the very late reply. Is this still an issue for you?
LilyFoote commented
If this is still an issue on v1.0.0
, please open a new issue.