Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Fix closed and deleted character string name chaining.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-LS committed Jan 19, 2022
1 parent 6066458 commit 1551b4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Insight/InsightSubsystems/Cron/CronTasks/NamesDoomheim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class NamesDoomheim(AbstractCronTask):
def call_now(self) -> bool:
return False
return True

def run_at_intervals(self) -> bool:
return False
Expand All @@ -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:
Expand All @@ -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)

0 comments on commit 1551b4a

Please sign in to comment.