1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 08:40:34 +03:00

EngineerProgress: Cope with no Rank/RankProgress in 'single engineer' form

Yes, this isn't DRY, if we do the check a third time I'll pull it out
into a helper function.
This commit is contained in:
Athanasius 2021-05-26 16:10:36 +01:00
parent c3b87df1b0
commit af5ffabd30

View File

@ -1696,6 +1696,12 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
for e in entry.get('Engineers', entry):
for f in ('Engineer', 'EngineerID', 'Rank', 'Progress', 'RankProgress'):
if f not in e:
# For some Progress there's no Rank/RankProgress yet
if f in ('Rank', 'RankProgress'):
if (progress := e.get('Progress', None)) is not None:
if progress in ('Invited', 'Known'):
continue
logger.warning(f"Engineer entry without '{f}' key: {e=} in {entry=}")
return False