diff --git a/InvenTree/InvenTree/middleware.py b/InvenTree/InvenTree/middleware.py index 3cd5aa74f7..2df90bc5b7 100644 --- a/InvenTree/InvenTree/middleware.py +++ b/InvenTree/InvenTree/middleware.py @@ -64,15 +64,15 @@ class AuthRequiredMiddleware(object): # No authorization was found for the request if not authorized: # A logout request will redirect the user to the login screen - if request.path_info == reverse_lazy('logout'): - return HttpResponseRedirect(reverse_lazy('login')) + if request.path_info == reverse_lazy('account_logout'): + return HttpResponseRedirect(reverse_lazy('account_login')) path = request.path_info # List of URL endpoints we *do not* want to redirect to urls = [ - reverse_lazy('login'), - reverse_lazy('logout'), + reverse_lazy('account_login'), + reverse_lazy('account_logout'), reverse_lazy('admin:login'), reverse_lazy('admin:logout'), ] @@ -80,7 +80,7 @@ class AuthRequiredMiddleware(object): if path not in urls and not path.startswith('/api/'): # Save the 'next' parameter to pass through to the login view - return redirect('%s?next=%s' % (reverse_lazy('login'), request.path)) + return redirect('%s?next=%s' % (reverse_lazy('account_login'), request.path)) response = self.get_response(request) diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 0ae6919669..b700743c98 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -8,7 +8,6 @@ Passes URL lookup downstream to each app as required. from django.conf.urls import url, include from django.urls import path from django.contrib import admin -from django.contrib.auth import views as auth_views from company.urls import company_urls from company.urls import manufacturer_part_urls @@ -142,9 +141,6 @@ urlpatterns = [ url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), - url(r'^login/?', auth_views.LoginView.as_view(), name='login'), - url(r'^logout/', auth_views.LogoutView.as_view(template_name='registration/logged_out.html'), name='logout'), - url(r'^settings/', include(settings_urls)), url(r'^edit-user/', EditUserView.as_view(), name='edit-user'), @@ -153,7 +149,6 @@ urlpatterns = [ url(r'^admin/error_log/', include('error_report.urls')), url(r'^admin/shell/', include('django_admin_shell.urls')), url(r'^admin/', admin.site.urls, name='inventree-admin'), - url(r'accounts/', include('django.contrib.auth.urls')), url(r'^index/', IndexView.as_view(), name='index'), url(r'^search/', SearchView.as_view(), name='search'), diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html index 39719edba0..2210746d44 100644 --- a/InvenTree/templates/navbar.html +++ b/InvenTree/templates/navbar.html @@ -86,9 +86,9 @@ {% if user.is_staff %}