From 89bc79215e32d4454d3c80e453df6876aa759a81 Mon Sep 17 00:00:00 2001 From: bearthatcares <149488155+bearthatcares@users.noreply.github.com> Date: Thu, 6 Jun 2024 09:00:20 -0400 Subject: [PATCH] Fix affiliations for characters with no alliance (#451) --- backend/eveonline/tasks.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/eveonline/tasks.py b/backend/eveonline/tasks.py index 7501e556..ec651c3f 100644 --- a/backend/eveonline/tasks.py +++ b/backend/eveonline/tasks.py @@ -104,6 +104,10 @@ def update_character_affilliations(): ) updated = True + if not alliance_id and character.alliance: + character.alliance = None + updated = True + if ( (faction_id and not character.faction) or faction_id @@ -112,6 +116,10 @@ def update_character_affilliations(): character.faction = EveFaction.objects.get(id=faction_id) updated = True + if not faction_id and character.faction: + character.faction = None + updated = True + if updated: logger.info( "Updating affiliations for character %s", character_id