removing reset password button from register view

This commit is contained in:
Élie Bouttier 2016-07-22 19:12:02 +02:00
parent ebc96aaad7
commit 4a762bc58a
2 changed files with 3 additions and 8 deletions

View File

@ -2,10 +2,12 @@ from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth import views as auth_views
from registration.backends.default import views as registration_views
from . import views
urlpatterns = [
url(r'^register/$', views.Registration.as_view(), name='register'),
url(r'^register/$', registration_views.RegistrationView.as_view(), name='register'),
url(r'^profile/$', views.profile, name='profile'),
url(r'^login/$', auth_views.login, {'extra_context': {'buttons': [views.RESET_PASSWORD_BUTTON]}}, name='login'),
url(r'^logout/$', auth_views.logout, {'next_page': settings.LOGOUT_REDIRECT_URL}, name='logout'),

View File

@ -5,8 +5,6 @@ from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, redirect, render
from registration.backends.default.views import RegistrationView
from .decorators import staff_required
from .forms import (NewParticipationForm, ParticipationForm,
ParticipationOrgaForm, ProfileForm, ProfileOrgaForm, UserForm)
@ -17,11 +15,6 @@ RESET_PASSWORD_BUTTON = ('password_reset', 'warning', 'Reset your password')
CHANGE_PASSWORD_BUTTON = ('password_change', 'warning', 'Change password')
class Registration(RegistrationView):
def get_context_data(self, **kwargs):
return super().get_context_data(buttons=[RESET_PASSWORD_BUTTON], **kwargs)
@login_required
def profile(request):