Error on notification list
http://test-paris.happy-dev.fr/notifications/ gives an error I don't understand. It wasn't the case with the previous version of djangoldp.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Contributor
can you provide the detail to test this - the urls and if necessary imports and the model definition
By Rob on 2018-11-01T23:41:45 (imported from GitLab project)
- Contributor
but it looks like this is the sort of issue: https://github.com/django-guardian/django-guardian/issues/152
By Rob on 2018-11-01T23:48:09 (imported from GitLab project)
- Contributor
if i try anonymous access with curl -i http://localhost:8000/job-offers/2
I get a 301 with Location: /job-offers/2/
this looks like a bug too :-(
By Rob on 2018-11-01T23:53:33 (imported from GitLab project)
- Contributor
looking at code and error, it looks like it is trying to serialise a ContentType model - so presumably this is a related field from inside the Notifications model (i dont have) - maybe we can and should exclude this field in the serialiser. I can dig into why and find a fix - but maybe its not something you want to ever do...
By Rob on 2018-11-02T00:23:37 (imported from GitLab project)
- Author Owner
Actually the notification model is this: https://git.happy-dev.fr/startinblox/djangoldp/blob/master/djangoldp/models.py#L20
- Author Owner
Doesn't look like there's a relation with contentType. i'm going to have a look this afternoon.
- Author Owner
I'm actually having the same issue with /users/
- Author Owner
Ok this is where it comes from: https://github.com/django-guardian/django-guardian/blob/devel/guardian/shortcuts.py#L499
- Author Owner
Got it. It is actually linked to https://git.happy-dev.fr/startinblox/djangoldp/issues/46. Because Notifications and User don't have a view permission, so the lookup doesn't work.
- Author Owner
Solved by removing django_restframework_guardian and adding a klass parameter.
- Sylvain Le Bon closed
closed