From 1551b4ab1d3c7194221437c33f4d8660896512ab Mon Sep 17 00:00:00 2001 From: Nathan S Date: Tue, 18 Jan 2022 17:20:08 -0800 Subject: [PATCH] Fix closed and deleted character string name chaining. --- Insight/InsightSubsystems/Cron/CronTasks/NamesDoomheim.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Insight/InsightSubsystems/Cron/CronTasks/NamesDoomheim.py b/Insight/InsightSubsystems/Cron/CronTasks/NamesDoomheim.py index f2a274b..f457395 100644 --- a/Insight/InsightSubsystems/Cron/CronTasks/NamesDoomheim.py +++ b/Insight/InsightSubsystems/Cron/CronTasks/NamesDoomheim.py @@ -4,7 +4,7 @@ class NamesDoomheim(AbstractCronTask): def call_now(self) -> bool: - return False + return True def run_at_intervals(self) -> bool: return False @@ -19,6 +19,8 @@ def _rename_duplicates(self, table_column_name, table_column_id, table): if len(duplicate_names) > 0: for n in duplicate_names: name = n[0] + if "(!Doomheim!)" in name or "(!Closed!)" in name: + continue update_objects = db.query(table).filter(table_column_name == name).order_by(table_column_id.desc()).all() row_iteration = 0 for row in update_objects: @@ -37,7 +39,7 @@ def _rename_duplicates(self, table_column_name, table_column_id, table): def _rename_duplicate_chars(self): self._rename_duplicates(tb_characters.character_name, tb_characters.character_id, tb_characters) self._rename_duplicates(tb_corporations.corporation_name, tb_corporations.corporation_id, tb_corporations) - self._rename_duplicates(tb_alliances.alliance_name, tb_alliances.alliance_name, tb_alliances) + self._rename_duplicates(tb_alliances.alliance_name, tb_alliances.alliance_id, tb_alliances) async def _run_task(self): await self.loop.run_in_executor(None, self._rename_duplicate_chars)