Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve some Django 1.10 deprecations #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions password_policies/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.conf.urls import include, patterns, url
from django.conf.urls import include, url

from password_policies.tests.views import TestHomeView


urlpatterns = patterns('',
url(r'^password/', include('password_policies.urls')),
url(r'^$', TestHomeView.as_view(), name='home'),
)
urlpatterns = [
url(r'^password/', include('password_policies.urls')),
url(r'^$', TestHomeView.as_view(), name='home'),
]
42 changes: 21 additions & 21 deletions password_policies/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import patterns, url
from django.conf.urls import url

from password_policies.views import PasswordChangeFormView
from password_policies.views import PasswordChangeDoneView
Expand All @@ -8,23 +8,23 @@
from password_policies.views import PasswordResetDoneView


urlpatterns = patterns('',
url(r'^change/done/$',
PasswordChangeDoneView.as_view(),
name="password_change_done"),
url(r'^change/$',
PasswordChangeFormView.as_view(),
name="password_change"),
url(r'^reset/$',
PasswordResetFormView.as_view(),
name="password_reset"),
url(r'^reset/complete/$',
PasswordResetCompleteView.as_view(),
name="password_reset_complete"),
url(r'^reset/confirm/([0-9A-Za-z_\-]+)/([0-9A-Za-z]{1,13})/([0-9A-Za-z-=_]{1,32})/$',
PasswordResetConfirmView.as_view(),
name="password_reset_confirm"),
url(r'^reset/done/$',
PasswordResetDoneView.as_view(),
name="password_reset_done"),
)
urlpatterns = [
url(r'^change/done/$',
PasswordChangeDoneView.as_view(),
name="password_change_done"),
url(r'^change/$',
PasswordChangeFormView.as_view(),
name="password_change"),
url(r'^reset/$',
PasswordResetFormView.as_view(),
name="password_reset"),
url(r'^reset/complete/$',
PasswordResetCompleteView.as_view(),
name="password_reset_complete"),
url(r'^reset/confirm/([0-9A-Za-z_\-]+)/([0-9A-Za-z]{1,13})/([0-9A-Za-z-=_]{1,32})/$',
PasswordResetConfirmView.as_view(),
name="password_reset_confirm"),
url(r'^reset/done/$',
PasswordResetDoneView.as_view(),
name="password_reset_done"),
]
8 changes: 6 additions & 2 deletions password_policies/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def form_valid(self, form):
form.save()
return super(PasswordChangeFormView, self).form_valid(form)

def get_form(self, form_class):
def get_form(self, form_class=None):
if form_class is None:
form_class = self.get_form_class()
return form_class(self.request.user, **self.get_form_kwargs())

def get_success_url(self):
Expand Down Expand Up @@ -184,7 +186,9 @@ def get_context_data(self, **kwargs):
kwargs['validlink'] = self.validlink
return super(PasswordResetConfirmView, self).get_context_data(**kwargs)

def get_form(self, form_class):
def get_form(self, form_class=None):
if form_class is None:
form_class = self.get_form_class()
return form_class(self.user, **self.get_form_kwargs())

def get_success_url(self):
Expand Down