|
|
|
@ -182,6 +182,20 @@ class TransactionParticipantCreateView(generics.CreateAPIView): |
|
|
|
) |
|
|
|
print(f'---> {type(transaction_participant)}/ {transaction_participant}') |
|
|
|
|
|
|
|
# 5. Update user birthdate based on participant infos |
|
|
|
validated_participant_infos = serializer.validated_data.get('participant_infos', []) |
|
|
|
for info in validated_participant_infos: |
|
|
|
email = info.get('email') |
|
|
|
birthdate = info.get('birthdate') |
|
|
|
if email and birthdate: |
|
|
|
try: |
|
|
|
target_user = User.objects.filter(email__iexact=email.strip()).first() |
|
|
|
if target_user: |
|
|
|
target_user.birthdate = birthdate |
|
|
|
target_user.save(update_fields=['birthdate']) |
|
|
|
except Exception as e: |
|
|
|
print(f"Error updating user birthdate: {e}") |
|
|
|
|
|
|
|
# ======================================================= |
|
|
|
# NEW LOGIC: HYBRID GEOLOCATION CHECK (Cloudflare + Local DB) |
|
|
|
# ======================================================= |
|
|
|
|