fix: Fix Apple registration during migration (#32893)
This commit is contained in:
@@ -228,11 +228,12 @@ class AppleIdAuth(BaseOAuth2):
|
||||
# belonging to already signed-in users.
|
||||
AppleMigrationUserIdInfo = apps.get_model('third_party_auth', 'AppleMigrationUserIdInfo')
|
||||
user_apple_id_info = AppleMigrationUserIdInfo.objects.filter(transfer_id=transfer_sub).first()
|
||||
old_apple_id = user_apple_id_info.old_apple_id
|
||||
if social_django.models.DjangoStorage.user.get_social_auth(provider=self.name, uid=old_apple_id):
|
||||
user_apple_id_info.new_apple_id = response.get(self.ID_KEY)
|
||||
user_apple_id_info.save()
|
||||
return user_apple_id_info.old_apple_id
|
||||
if user_apple_id_info:
|
||||
old_apple_id = user_apple_id_info.old_apple_id
|
||||
if social_django.models.DjangoStorage.user.get_social_auth(provider=self.name, uid=old_apple_id):
|
||||
user_apple_id_info.new_apple_id = response.get(self.ID_KEY)
|
||||
user_apple_id_info.save()
|
||||
return user_apple_id_info.old_apple_id
|
||||
|
||||
return apple_id
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class Command(BaseCommand):
|
||||
new_apple_id = ''
|
||||
except (requests.exceptions.JSONDecodeError, AttributeError):
|
||||
log.info('JSONDecodeError/AttributeError for transfer_id %s.', transfer_id)
|
||||
transfer_id = ''
|
||||
new_apple_id = ''
|
||||
|
||||
return new_apple_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user