From e7af551bee47622527b49b38f719deecbe30a71d Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Wed, 11 Oct 2017 11:44:46 +0100 Subject: [PATCH] Fixed crash trying to report on a system with reports disabled. --- plugin/faction/faction.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin/faction/faction.py b/plugin/faction/faction.py index ec51060..0f85e13 100644 --- a/plugin/faction/faction.py +++ b/plugin/faction/faction.py @@ -601,6 +601,9 @@ class Faction(DBConnection): await self.report_stale_faction_influence(channel, id = tracked.faction_id) async def report_tracked_system(self, tracked): + if tracked.channel_id is None: + return + update = {} update['updated'] = self.now() @@ -671,10 +674,10 @@ class Faction(DBConnection): system_names = [row['system_name'] for row in cursor.fetchall()] self.close_db() if len(system_names): - result = await self.graph_faction_history(channel, systems = system_names, start_date = then) - if not result: - log.warning('Failed summary graph for faction {}'.format(tracked.id)) - return + for name in system_names: + result = await self.graph_faction_history(channel, systems = [name], start_date = then) + if not result: + log.warning('Failed summary graph for faction {}'.format(tracked.id)) else: log.info('No systems updated since {} for faction {}'.format(bot.iso8601(then), tracked.name)) if what == 'faction': -- 2.7.4