From 1b252baf78860c94922a18b75ed0fb6fa4560f68 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Thu, 15 May 2025 11:26:53 +0300 Subject: [PATCH] Features: 1) Allow `referrer` field to accept a string instead of UUID; Fixes: None; Extra: 1) Fix indentation inconsistencies in `mutate` method and attribute check block; --- vibes_auth/graphene/mutations.py | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/vibes_auth/graphene/mutations.py b/vibes_auth/graphene/mutations.py index caccde58..42aeee50 100644 --- a/vibes_auth/graphene/mutations.py +++ b/vibes_auth/graphene/mutations.py @@ -37,22 +37,22 @@ class CreateUser(BaseMutation): phone_number = String() is_subscribed = Boolean() language = String() - referrer = UUID(required=False, description=_("the user's b64-encoded uuid who referred the new user to us.")) + referrer = String(required=False, description=_("the user's b64-encoded uuid who referred the new user to us.")) success = Boolean() def mutate( - self, - info, - email, - password, - confirm_password, - last_name=None, - first_name=None, - phone_number=None, - is_subscribed=None, - language=None, - **kwargs, + self, + info, + email, + password, + confirm_password, + last_name=None, + first_name=None, + phone_number=None, + is_subscribed=None, + language=None, + **kwargs, ): try: if compare_digest(password, confirm_password): @@ -138,17 +138,17 @@ class UpdateUser(BaseMutation): "password", "confirm_password", ] and ( - attr - not in [ - "groups", - "user_permissions", - "phone_number", - "is_verified", - "is_staff", - "is_active", - "is_superuser", - ] - or info.context.user.has_perm("vibes_auth.change_user") + attr + not in [ + "groups", + "user_permissions", + "phone_number", + "is_verified", + "is_staff", + "is_active", + "is_superuser", + ] + or info.context.user.has_perm("vibes_auth.change_user") ): setattr(user, attr, value)