dfunckt / django-rules

Awesome Django authorization, without the database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add the possibility to specify the view to which the user is redirected

cormier opened this issue · comments

Currently the user is redirected to the login page regardless of whether she is logged or not.

I believe that instead of always redirecting to login, it would be helpful to let users specify a redirection view that is more useful for them.

You can customise the login URL either by setting it directly as a class attribute to your view, or by overriding get_login_url(). See here: https://github.com/dfunckt/django-rules/blob/master/rules/compat/access_mixins.py#L57

Either way, this functionality comes from Django (access_mixins.py is merely a redistribution of Django's module, provided by rules for backwards compatibility) and I don't intend to provide extra functionality.