-
I am a bit stuck on #196. Setting up the crud functionality with the django rest framework was relatively straightforward and it is working. But being a newbie, I struggle adding the permissions. I am able to get the circle_id from the Activity.object, but despite various attempts no luck so far, checking this id with the Circle.object to verify whether the user in the request is a companion or organizer (or both). As an example this part:
This leads to an assertion error
I am probably overlooking something , therefore some help would be very much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
From the code above, I don't see any default return for the |
Beta Was this translation helpful? Give feedback.
-
Excellent, that resolved it. |
Beta Was this translation helpful? Give feedback.
-
Hello @brylie, Is it correct that GET requests are not needed? I added two of them anyway, just to make sure I could read the data. If not necessary, I will delete this part. To test the working of the API in the browser, I added session authentication in settings.py:
and this path in urls.py:
Please let me know if I need to delete this. Thanks, Bas |
Beta Was this translation helpful? Give feedback.
From the code above, I don't see any default return for the
elif
statement. All returns are nested withif
statements within theelif
. This would make the defaultelif
return to beNone
, as the error seems to indicate.