Skip to content

Commit

Permalink
Mimic new django get_form()
Browse files Browse the repository at this point in the history
  • Loading branch information
hobzcalvin committed Aug 8, 2016
1 parent f974aad commit ca719ca
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit ca719ca

Please sign in to comment.