How to correctly subclass the 'PasswordResetConfirmView' view

94 views
Skip to first unread message

disp

unread,
Aug 17, 2017, 11:57:00 AM8/17/17
to Django users
I have subclassed the view PasswordResetConfirmView because I want to pass in my own form, however, I keep getting the following error:



Sometimes the error reads: get() got an unexpected keyword argument 'token'.

My view looks like this:

class CustomPasswordResetConfirmView(PasswordResetConfirmView):
form_class = SetPasswordForm

def get(self, request, token=None, uidb64=None):
super(CustomPasswordResetConfirmView, self).get(request, token=token, uidb64=uidb64)
return render(request, 'registration/password_reset_confirm.html')

The URL connected to this view is:

url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
views.CustomPasswordResetConfirmView.as_view(), name='password_reset_confirm'),


I've tried everything I can think of but I always get the error above.

Any help will be greatly appreciated.
Reply all
Reply to author
Forward
0 new messages