From 3ac8ea660ac2c9533c67688cc202854342b1d10a Mon Sep 17 00:00:00 2001 From: Burathar Date: Sat, 18 Jul 2020 01:54:28 +0200 Subject: [PATCH] add pylint ignore comment --- app/models.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/models.py b/app/models.py index 25d738b..587cd6d 100644 --- a/app/models.py +++ b/app/models.py @@ -93,9 +93,10 @@ class Game(db.Model): locations.append(player.last_location(self)) return locations -def owned_by(self, player): - '''given player is an owner of game''' - return player in [gameplayer.player for gameplayer in self.game_players if gameplayer.role == Role.owner] + def owned_by(self, player): + # pylint: disable=not-an-iterable + '''given player is an owner of game''' + return player in [gameplayer.player for gameplayer in self.game_players if gameplayer.role == Role.owner] class Player(UserMixin, db.Model): """ !Always call set_auth_hash() after creating new instance! """ @@ -182,11 +183,11 @@ class Player(UserMixin, db.Model): return None return gameplayers[0].role -def owns_game_played_by(self, player): - '''self is an owner of a game the player participates in''' - return self in [gameplayer.player for gameplayers in - [game.game_players for game in player.games] - for gameplayer in gameplayers if gameplayer.role == Role.owner] + def owns_game_played_by(self, player): + '''self is an owner of a game the player participates in''' + return self in [gameplayer.player for gameplayers in + [game.game_players for game in player.games] + for gameplayer in gameplayers if gameplayer.role == Role.owner] @staticmethod def delete_orphans():