Skip to content

Commit

Permalink
Fixed issue when creating/editing profile: the AddressForm needs a us…
Browse files Browse the repository at this point in the history
…er as args.
  • Loading branch information
serge-gaia committed Oct 11, 2016
1 parent 89c5e8e commit 90c932c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wildlifelicensing/apps/applications/views/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def get_context_data(self, **kwargs):
initial_email=application.applicant.email,
user=application.applicant)

kwargs['address_form'] = AddressForm()
kwargs['address_form'] = AddressForm(user=application.applicant)

return super(CreateSelectProfileView, self).get_context_data(**kwargs)

Expand All @@ -400,7 +400,7 @@ def post(self, request, *args, **kwargs):
return render(request, self.template_name, {'licence_type': application.licence_type,
'profile_selection_form': profile_selection_form,
'profile_creation_form': ProfileForm(),
'address_form': AddressForm()})
'address_form': AddressForm(user=application.applicant)})
elif 'create' in request.POST:
profile_form = ProfileForm(request.POST)
address_form = AddressForm(request.POST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def get_context_data(self, **kwargs):
kwargs['address_form'] = AddressForm(instance=profile.postal_address)
else:
kwargs['profile_form'] = ProfileForm(user=customer)
kwargs['address_form'] = AddressForm()
kwargs['address_form'] = AddressForm(user=customer)

return super(EditProfileView, self).get_context_data(**kwargs)

Expand Down

0 comments on commit 90c932c

Please sign in to comment.