Verified Commit 7e0f2d08 authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Remove Profile validation code in create_user command (Profile validation can't fail)

parent 866b0e61
Pipeline #282397 passed with stage
in 32 minutes and 18 seconds
...@@ -61,11 +61,6 @@ class Command(BaseCommand): ...@@ -61,11 +61,6 @@ class Command(BaseCommand):
except ValidationError as e: except ValidationError as e:
raise CommandError(f'Failed to create a new user: {str(e)}') raise CommandError(f'Failed to create a new user: {str(e)}')
new_profile = None new_profile = Profile(user=new_user)
try:
new_profile = Profile(user=new_user) new_profile.save()
new_profile.full_clean()
except ValidationError as e:
raise CommandError(f'Failed to create a new user profile: {str(e)}')
else:
new_profile.save()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment