Skip to content

Commit

Permalink
Use LoginView instead of login() for future compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Oct 12, 2017
1 parent 4b7161b commit dad2439
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zinnia/views/mixins/entry_protection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Protection mixins for Zinnia views"""
from django.contrib.auth.views import login
from django.contrib.auth.views import LoginView


class LoginMixin(object):
Expand All @@ -12,7 +12,9 @@ def login(self):
"""
Return the login view.
"""
return login(self.request, 'zinnia/login.html')
return LoginView.as_view(
template_name='zinnia/login.html'
)(self.request)


class PasswordMixin(object):
Expand Down

0 comments on commit dad2439

Please sign in to comment.