Good day,
I have the following in my URLConf:
from django.contrib.auth.decorators import user_passes_test
urlpatterns = patterns('',
(r'^manage/(?P<pk>\d+)/$', user_passes_test(lambda u: (u.is_authenticated()))
UpdateView.as_view(model=Organization, success_url="/organizations/updated/", template_name="organization/manage.html",))),
So only authenticated users can access the view functionality via the url.
Question: Except for sub-classing the generic view, is there a way to inspect the pk embedded in the URL? I'd like to further validate that the user trying to access the Update function has the required permission.
The documentation doesn't go into this detail, and I'm battling to find any other reference to it.