diff --git a/alliance_auth/settings.py.example b/alliance_auth/settings.py.example index 8675ccba..dffdfd4b 100644 --- a/alliance_auth/settings.py.example +++ b/alliance_auth/settings.py.example @@ -620,9 +620,3 @@ if 'services.modules.teamspeak3' in INSTALLED_APPS: 'task': 'services.modules.teamspeak3.tasks.run_ts3_group_update', 'schedule': crontab(minute='*/30'), } - -if 'services.modules.seat' in INSTALLED_APPS: - CELERYBEAT_SCHEDULE['run_seat_api_sync'] = { - 'task': 'services.modules.seat.tasks.run_api_sync', - 'schedule': crontab(minute='*/30'), - } diff --git a/authentication/migrations/0013_service_modules.py b/authentication/migrations/0013_service_modules.py index f52443d5..c053448d 100644 --- a/authentication/migrations/0013_service_modules.py +++ b/authentication/migrations/0013_service_modules.py @@ -23,7 +23,7 @@ def optional_dependencies(): dependencies = [] # Skip adding module dependencies if the settings specifies that services have been migrated - if not hasattr(settings, 'SERVICES_MIGRATED') or settings.SERVICES_MIGRATED: + if getattr(settings, 'SERVICES_MIGRATED', True): return dependencies if 'services.modules.xenforo' in installed_apps: diff --git a/authentication/signals.py b/authentication/signals.py index 52987a46..7b51f009 100644 --- a/authentication/signals.py +++ b/authentication/signals.py @@ -98,11 +98,12 @@ def validate_main_character(sender, instance, *args, **kwargs): @receiver(pre_delete, sender=Token) def validate_main_character_token(sender, instance, *args, **kwargs): - if UserProfile.objects.filter(main_character__character_id=instance.character_id): - if not Token.objects.filter(character_id=instance.character_id).filter(user=instance.user).exists(): + if UserProfile.objects.filter(main_character__character_id=instance.character_id).exists(): + profile = UserProfile.objects.get(main_character__character_id=instance.character_id) + if not Token.objects.filter(character_id=instance.character_id).filter(user=profile.user).exclude(pk=instance.pk).exists(): # clear main character as we can no longer verify ownership - instance.user.profile.main_character = None - instance.user.profile.save() + profile.main_character = None + profile.save() @receiver(post_save, sender=User)