From af54db6c136138c66cf5ca72419989525a0baa5c Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Tue, 7 Aug 2018 15:09:08 +0100 Subject: Initial project layout for django --- pysite/views/main/bot/cleanlog.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 pysite/views/main/bot/cleanlog.py (limited to 'pysite/views/main/bot/cleanlog.py') diff --git a/pysite/views/main/bot/cleanlog.py b/pysite/views/main/bot/cleanlog.py deleted file mode 100644 index 9c719b3e..00000000 --- a/pysite/views/main/bot/cleanlog.py +++ /dev/null @@ -1,35 +0,0 @@ -import logging - -from pysite.base_route import RouteView -from pysite.constants import ALL_STAFF_ROLES, DEVELOPERS_ROLE, ROLE_COLORS -from pysite.decorators import require_roles -from pysite.mixins import DBMixin, OAuthMixin - -log = logging.getLogger(__name__) - - -class CleanLogView(RouteView, DBMixin, OAuthMixin): - path = "/bot/clean_logs/" - name = "bot.clean_logs" - - table_name = "clean_logs" - template = "main/bot/clean_logs.html" - - @require_roles(ALL_STAFF_ROLES) - def get(self, log_id): - """ - Get the requested clean log and spit it out - in a beautiful template. - """ - - data = self.db.get(self.table_name, log_id) - - if data is None: - return "ID could not be found in the database", 404 - - messages = data["log_data"] - - for message in messages: - message['color'] = ROLE_COLORS.get(message['role_id'], ROLE_COLORS[DEVELOPERS_ROLE]) - - return self.render(self.template, messages=messages) -- cgit v1.2.3