FIX: Re-add overridden login view

This commit is contained in:
2020-03-07 15:25:58 +00:00
parent 5c5ccd244d
commit 739913a2c9
3 changed files with 3 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ class UserRegistrationTest(LiveServerTestCase):
alert = self.browser.find_element_by_css_selector(
'div.alert-danger').text
# Note to future maintainers - mind out for smart quotes...
self.assertIn("password fields didnt match", alert)
self.assertIn("password fields didn't match", alert)
# Passwords should be empty
self.assertEqual(password1.get_attribute('value'), '')

View File

@@ -17,6 +17,7 @@ urlpatterns = [
url('^$', login_required(views.Index.as_view()), name='index'),
url(r'^closemodal/$', views.CloseModal.as_view(), name='closemodal'),
path('user/login/', views.login, name='login'),
path('user/login/embed/', xframe_options_exempt(views.LoginEmbed.as_view()), name='login_embed'),
url(r'^search_help/$', views.SearchHelp.as_view(), name='search_help'),

View File

@@ -34,7 +34,7 @@ class Index(generic.TemplateView):
context['rig_count'] = models.Event.objects.rig_count()
return context
# TODO: CBV?
def login(request, **kwargs):
if request.user.is_authenticated:
next = request.GET.get('next', '/')