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

profile is first created via signal.

parent 39900094
No related branches found
No related tags found
1 merge request!52Minors fix
...@@ -49,10 +49,10 @@ class UserCreateView(CreateView): ...@@ -49,10 +49,10 @@ class UserCreateView(CreateView):
def form_valid(self, form): def form_valid(self, form):
profile_form = ProfileForm(self.request.POST) profile_form = ProfileForm(self.request.POST)
if form.is_valid() and profile_form.is_valid(): if form.is_valid() and profile_form.is_valid():
user = form.save() user = form.save(commit=False)
profile = profile_form.save(commit=False) user.profile = profile_form.save(commit=False)
profile.user = user user.save()
profile.save() user.profile.save()
return super().form_valid(form) 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