From 70619fc1c7b13f0311170d6087b5b42ae876cb49 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 27 Dec 2020 15:14:42 +0200 Subject: [PATCH] Fix unbound variable warning. --- django_etebase/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index dce2fe6..26ac5a7 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -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: