remove unused LogoutView and corresponding url pattern
This commit is contained in:
parent
d78bad06b7
commit
f211b535cf
3 changed files with 3 additions and 18 deletions
|
@ -9,9 +9,8 @@ from django.views.generic import (
|
|||
DetailView,
|
||||
TemplateView,
|
||||
)
|
||||
from django.views.generic.base import RedirectView
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.contrib.auth import get_user_model, logout
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from braces.views import LoginRequiredMixin
|
||||
|
||||
|
@ -51,16 +50,3 @@ class UserDashboardView(LoginRequiredMixin, DetailView):
|
|||
customer=self.object
|
||||
)
|
||||
return context
|
||||
|
||||
|
||||
class LogoutView(RedirectView):
|
||||
pattern_name = 'dashboard'
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
logout(self.request)
|
||||
return super(LogoutView, self).get(*args, **kwargs)
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
if 'next' in self.request.GET:
|
||||
return self.request.GET['next']
|
||||
return super(LogoutView, self).get_redirect_url(*args, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue