diff --git a/ws/merge.py b/ws/merge.py index fedc8adc..9b99fb38 100644 --- a/ws/merge.py +++ b/ws/merge.py @@ -52,6 +52,7 @@ 'auth_user_user_permissions': ('user_id',), 'account_emailaddress': ('user_id',), 'django_admin_log': ('user_id',), + 'socialaccount_socialaccount': ('user_id',), 'ws_participant': ('user_id',), } @@ -146,7 +147,7 @@ def _update_lotteryinfo(cursor, old_pk, new_pk): cursor.execute(sql, {'old_pk': old_pk, 'new_pk': new_pk}) -def _migrate_user(old_pk, new_pk): +def _migrate_user(old_pk: int, new_pk: int) -> None: """Copy over any email addresses and groups from the old user.""" cursor = connections['default'].cursor() @@ -225,6 +226,6 @@ def _migrate_participant(old_pk, new_pk): def merge_participants(old, new): - with transaction.atomic(): # Rollback if FK migration fails + with transaction.atomic(): # Roll back if FK migration fails _migrate_user(old.user_id, new.user_id) _migrate_participant(old.pk, new.pk) diff --git a/ws/settings.py b/ws/settings.py index 7a110907..1515b719 100644 --- a/ws/settings.py +++ b/ws/settings.py @@ -95,6 +95,8 @@ 'phonenumber_field', 'allauth', 'allauth.account', + 'allauth.socialaccount', + 'allauth.socialaccount.providers.google', 'crispy_forms', 'pipeline', 'ws.apps.TripsConfig', diff --git a/ws/tests/test_merge.py b/ws/tests/test_merge.py index d139b4fb..9b92ca47 100644 --- a/ws/tests/test_merge.py +++ b/ws/tests/test_merge.py @@ -31,6 +31,7 @@ def test_check_fk_tables_missing_fk(self): 'auth_user_groups': 'user_id', 'account_emailaddress': 'user_id', # 'django_admin_log': 'user_id', + 'socialaccount_socialaccount': ('user_id',), 'ws_participant': 'user_id', } with self.assertRaises(ValueError) as err: