fix(users): update referral code handling to ensure uniqueness and proper formatting

Implement logic to clean and standardize referral codes in the users table. This includes setting referral codes to NULL if they are empty or consist only of whitespace, and generating unique referral codes for users with duplicates. The changes enhance data integrity and ensure consistent formatting of referral codes across the database.
This commit is contained in:
kavore
2026-02-12 16:44:14 +03:00
parent b164fbd9bb
commit 5d00124ca0
3 changed files with 49 additions and 13 deletions
+1 -1
View File
@@ -624,7 +624,7 @@ async def yookassa_webhook_route(request: web.Request):
logging.error(
f"YooKassa webhook payment {payment_data_from_notification.id} lacks metadata. Cannot process."
)
return web.Response(status=503, text="yookassa_missing_metadata")
return web.Response(status=200, text="yookassa_missing_metadata")
# Safely extract payment_method details (SDK objects may not have to_dict)
pm_obj = getattr(payment_data_from_notification, 'payment_method', None)