Przeglądaj źródła

Redirect user to previous page after logging in

Jeremy Stretch 9 lat temu
rodzic
commit
579ed0a985
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      netbox/utilities/middleware.py

+ 1 - 1
netbox/utilities/middleware.py

@@ -12,4 +12,4 @@ class LoginRequiredMiddleware:
     def process_request(self, request):
         if LOGIN_REQUIRED and not request.user.is_authenticated():
             if request.path_info != settings.LOGIN_URL:
-                return HttpResponseRedirect(settings.LOGIN_URL)
+                return HttpResponseRedirect('{}?next={}'.format(settings.LOGIN_URL, request.path_info))