Skip to content

Commit

Permalink
Fix affiliations for characters with no alliance (minmatarfleet#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
bearthatcares authored Jun 6, 2024
1 parent 2222452 commit 89bc792
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/eveonline/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 89bc792

Please sign in to comment.