From: CMDR furrycat Date: Wed, 11 Oct 2017 10:44:46 +0000 (+0100) Subject: Fixed crash trying to report on a system with reports disabled. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=e7af551bee47622527b49b38f719deecbe30a71d;p=furrycat%2Fcatbot.git Fixed crash trying to report on a system with reports disabled. --- 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':