From da69239f49d77952058d555687a8a45dffd04e5b Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 3 Jul 2020 22:45:39 +0100 Subject: [PATCH] Use class variables for RoomMixin Caused bug where igloos weren't being created. This is required to cohere to PEP8 guidelines. --- houdini/data/room.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/houdini/data/room.py b/houdini/data/room.py index 1d77d20..028d624 100644 --- a/houdini/data/room.py +++ b/houdini/data/room.py @@ -11,6 +11,9 @@ def stealth_mod_filter(stealth_mod_id): class RoomMixin: + id = None + max_users = None + def __init__(self, *args, **kwargs): self.penguins_by_id = {} self.penguins_by_username = {} @@ -22,9 +25,6 @@ class RoomMixin: self.tables = {} self.waddles = {} - self.id = None - self.max_users = None - async def add_penguin(self, p): if len(self.penguins_by_id) >= self.max_users and not p.moderator: return await p.send_error(210) @@ -176,8 +176,6 @@ class PenguinIglooRoom(db.Model, RoomMixin): super().__init__(*args, **kwargs) RoomMixin.__init__(self, *args, **kwargs) - self.max_users = 80 - @property def external_id(self): return self.penguin_id + PenguinIglooRoom.internal_id