Created
March 20, 2019 07:53
-
-
Save sankalpjonn/48422adc8e58ff3ed41461407226c9f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client_user_email = validated_data['email'] | |
try: | |
client_user = User.objects.get(username=client_user_email) | |
except User.DoesNotExist: | |
raise Exception("this email was not invited") | |
client_user.is_active=True | |
client_user.set_password(validated_data['password1']) | |
client_user.save() | |
token, _ = Token.objects.get_or_create(user=client_user) | |
return token.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment