1
0
mirror of https://github.com/etesync/server synced 2024-12-28 18:28:07 +00:00

Fix unbound variable warning.

This commit is contained in:
Tom Hacohen 2020-12-27 15:14:42 +02:00
parent c2eb4fd30c
commit 70619fc1c7

View File

@ -513,8 +513,8 @@ class AuthenticationSignupSerializer(BetterErrorsMixin, serializers.Serializer):
user_data = validated_data.pop("user")
with transaction.atomic():
view = self.context.get("view", None)
try:
view = self.context.get("view", None)
user_queryset = get_user_queryset(User.objects.all(), context=CallbackContext(view.kwargs))
instance = user_queryset.get(**{User.USERNAME_FIELD: user_data["username"].lower()})
except User.DoesNotExist: