Skip to content

Commit

Permalink
fix management of error on user create
Browse files Browse the repository at this point in the history
  • Loading branch information
RignonNoel committed Oct 3, 2020
1 parent ee38eae commit e1bd44b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blitz_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ def update(self, request, *args, **kwargs):

def create(self, request, *args, **kwargs):
response = super().create(request, *args, **kwargs)
user = User.objects.get(email=request.data["email"])
if response.status_code == status.HTTP_201_CREATED:
user = User.objects.get(email=request.data["email"])

if settings.LOCAL_SETTINGS['AUTO_ACTIVATE_USER'] is True:
user.is_active = True
user.save()
Expand Down

0 comments on commit e1bd44b

Please sign in to comment.