Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to create a feature without session throws ValueError #26

Open
MikkoJo opened this issue Oct 22, 2012 · 0 comments
Open

Trying to create a feature without session throws ValueError #26

MikkoJo opened this issue Oct 22, 2012 · 0 comments

Comments

@MikkoJo
Copy link
Contributor

MikkoJo commented Oct 22, 2012

When trying to create a feature without a session and default user (@me) application should return HTTP:400 Bad Request. Instead it tries to assign AnonymousUser to the feature and throws a ValueError.

Traceback (most recent call last):
File "/home/msjohans/virtualenvs/geonition_test/src/geojson-rest/geojson_rest/tests.py", line 174, in test_unauthorized_post
content_type = 'application/json')
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/test/client.py", line 262, in post
return self.request(**r)
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, _callback_args, *_callback_kwargs)
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view
return self.dispatch(request, _args, *_kwargs)
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch
return handler(request, _args, *_kwargs)
File "/home/msjohans/virtualenvs/geonition_test/src/geojson-rest/geojson_rest/views.py", line 97, in post
group = group)
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/db/models/base.py", line 355, in init
setattr(self, field.name, rel_obj)
File "/home/msjohans/virtualenvs/geonition_test/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 366, in set
self.field.name, self.field.rel.to._meta.object_name))
ValueError: Cannot assign "<django.utils.functional.SimpleLazyObject object at 0xa1dfa6c>": "Feature.user" must be a "User" instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant