Thanks Bruno, I was decorating the 'post' method. I've got it right now.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I solved this using a "method_decorator" and "user_passes_test".
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To
Hi Daniel.
You're looking for the `user_passes_test` decorator:
https://docs.djangoproject.com/en/1.7/topics/auth/default/#limiting-access-to-logged-in-users-that-pass-a-test
Remember you need to decorate the `dispatch` method of a CBV.
--
You received this message because you are subscribed
Hi,
Say I have a function as follows:
def is_supervisor(user):
return user.groups.filter(name='supervisor').exists()
...and a CBV for deleting records:
class DeleteFlow(DeleteView):
# etc...
How can I restrict access to this view using the function?
I understand that this may be
4 matches
Mail list logo