Skip to content
Snippets Groups Projects
Commit f66be94c authored by Pierre-antoine Comby's avatar Pierre-antoine Comby
Browse files

profile is first created via signal.

parent c0fff202
No related branches found
No related tags found
No related merge requests found
......@@ -49,10 +49,10 @@ class UserCreateView(CreateView):
def form_valid(self, form):
profile_form = ProfileForm(self.request.POST)
if form.is_valid() and profile_form.is_valid():
user = form.save()
profile = profile_form.save(commit=False)
profile.user = user
profile.save()
user = form.save(commit=False)
user.profile = profile_form.save(commit=False)
user.save()
user.profile.save()
return super().form_valid(form)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment