From 59ee52ec9ae239cd3c1e118f38c8a66c25880016 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:13:51 +0530 Subject: [PATCH 1/3] fix: phone number / email is being set to `'None'` for new users --- app_users/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app_users/models.py b/app_users/models.py index 14aec25aa..feed0bc35 100644 --- a/app_users/models.py +++ b/app_users/models.py @@ -184,8 +184,10 @@ def copy_from_firebase_user(self, user: auth.UserRecord) -> "AppUser": self.uid = user.uid self.is_disabled = user.disabled self.display_name = user.display_name or "" - self.email = str(user.email) - self.phone_number = str(user.phone_number) + if user.email: + self.email = str(user.email) + if user.phone_number: + self.phone_number = str(user.phone_number) self.created_at = timezone.datetime.fromtimestamp( user.user_metadata.creation_timestamp / 1000 ) From c8483ed5469ebd575611fab19b1ae1df67a2b467 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:22:11 +0530 Subject: [PATCH 2/3] add script to fix historical data for email or phone number is str(None) --- .../fix_email_or_phone_number_is_str_None.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/fix_email_or_phone_number_is_str_None.py diff --git a/scripts/fix_email_or_phone_number_is_str_None.py b/scripts/fix_email_or_phone_number_is_str_None.py new file mode 100644 index 000000000..d2a25f2cc --- /dev/null +++ b/scripts/fix_email_or_phone_number_is_str_None.py @@ -0,0 +1,17 @@ +from app_users.models import AppUser +from .migrate_workspaces import update_in_batches + + +def run(): + fix_email_is_str_None() + fix_phone_number_is_str_None() + + +def fix_email_is_str_None(): + qs = AppUser.objects.filter(email="None") + update_in_batches(qs, email=None) + + +def fix_phone_number_is_str_None(): + qs = AppUser.objects.filter(phone_number="None") + update_in_batches(qs, phone_number=None) From e79294a9121037973e55bf6047a23304ba57e781 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Thu, 5 Dec 2024 21:25:14 +0530 Subject: [PATCH 3/3] fix link in comment to replicate model for gfpgan --- daras_ai_v2/upscaler_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daras_ai_v2/upscaler_models.py b/daras_ai_v2/upscaler_models.py index 11d8ff225..2c14c35f0 100644 --- a/daras_ai_v2/upscaler_models.py +++ b/daras_ai_v2/upscaler_models.py @@ -120,7 +120,7 @@ def gfpgan(img: str, scale: int = 1) -> bytes: elif scale != 2: scale *= 2 - # https://replicate.com/nightmareai/real-esrgan/versions/42fed1c4974146d4d2414e2be2c5277c7fcf05fcc3a73abf41610695738c1d7b#output-schema + # https://replicate.com/tencentarc/gfpgan/versions/9283608cc6b7be6b65a8e44983db012355fde4132009bf99d976b2f0896856a3 model = replicate.models.get(UpscalerModels.gfpgan.model_id) version = model.versions.get( "9283608cc6b7be6b65a8e44983db012355fde4132009bf99d976b2f0896856a3"