Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Dec 5, 2024
2 parents fe2b3e1 + 841efe0 commit f11a4a3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app_users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion daras_ai_v2/upscaler_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 17 additions & 0 deletions scripts/fix_email_or_phone_number_is_str_None.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit f11a4a3

Please sign in to comment.