Skip to content

Commit

Permalink
Update serializers.py
Browse files Browse the repository at this point in the history
Fixing a 500 when an invalid token and user combo isn't found.
  • Loading branch information
aaronn committed Apr 17, 2020
1 parent b83dca2 commit 422ecb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drfpasswordless/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ def validate(self, attrs):
else:
msg = _('Invalid Token')
raise serializers.ValidationError(msg)
except CallbackToken.DoesNotExist:
msg = _('Invalid alias parameters provided.')
raise serializers.ValidationError(msg)
except User.DoesNotExist:
msg = _('Invalid alias parameters provided.')
raise serializers.ValidationError(msg)
Expand Down

0 comments on commit 422ecb7

Please sign in to comment.