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
|
@ -1,6 +1,8 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
* :support:`-` remove unused dashboard.views.LogoutView and the corresponding
|
||||
URL in dashboard.urls
|
||||
* :feature:`-` add new task stub to set an ldap user's password
|
||||
* :support:`-` refactor osusers.tasks, split into fileservertasks.tasks and
|
||||
ldaptasks.tasks
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.conf.urls import patterns, url
|
|||
|
||||
from .views import (
|
||||
IndexView,
|
||||
LogoutView,
|
||||
UserDashboardView,
|
||||
)
|
||||
|
||||
|
@ -14,6 +13,4 @@ urlpatterns = patterns(
|
|||
url(r'^$', IndexView.as_view(), name='dashboard'),
|
||||
url(r'^user/(?P<slug>[\w0-9@.+-_]+)/$',
|
||||
UserDashboardView.as_view(), name='customer_dashboard'),
|
||||
url(r'^logout/',
|
||||
LogoutView.as_view(), name='logout'),
|
||||
)
|
||||
|
|
|
@ -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…
Reference in a new issue