mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Redirect user to previous page after logging in
This commit is contained in:
@ -12,4 +12,4 @@ class LoginRequiredMiddleware:
|
|||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
if LOGIN_REQUIRED and not request.user.is_authenticated():
|
if LOGIN_REQUIRED and not request.user.is_authenticated():
|
||||||
if request.path_info != settings.LOGIN_URL:
|
if request.path_info != settings.LOGIN_URL:
|
||||||
return HttpResponseRedirect(settings.LOGIN_URL)
|
return HttpResponseRedirect('{}?next={}'.format(settings.LOGIN_URL, request.path_info))
|
||||||
|
Reference in New Issue
Block a user