|
|
|
@ -63,15 +63,13 @@ class RegistrationForm(RegistrationFormUniqueEmail): |
|
|
|
def save(self, commit=True): |
|
|
|
def save(self, commit=True): |
|
|
|
user = super().save(commit) |
|
|
|
user = super().save(commit) |
|
|
|
profile = Profile.objects.filter(user=user).first() |
|
|
|
profile = Profile.objects.filter(user=user).first() |
|
|
|
if profile: |
|
|
|
if not profile: |
|
|
|
profile.first_name = self.cleaned_data['first_name'] |
|
|
|
profile = Profile() |
|
|
|
profile.last_name = self.cleaned_data['last_name'] |
|
|
|
|
|
|
|
profile.patronymic = self.cleaned_data['patronymic'] |
|
|
|
profile.first_name = self.cleaned_data['first_name'] |
|
|
|
profile.save() |
|
|
|
profile.last_name = self.cleaned_data['last_name'] |
|
|
|
else: |
|
|
|
profile.patronymic = self.cleaned_data['patronymic'] |
|
|
|
logger.error( |
|
|
|
profile.save() |
|
|
|
msg="User {user_email} missing profile object".format({'user_email': self.cleaned_data['email']}) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return user |
|
|
|
return user |
|
|
|
|
|
|
|
|
|
|
|
|