aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/staff/index.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-08-07 15:09:08 +0100
committerGravatar Gareth Coles <[email protected]>2018-08-07 15:09:16 +0100
commitaf54db6c136138c66cf5ca72419989525a0baa5c (patch)
tree8519aeab8d45277c51797c7dc23aacf3b56ed1bb /pysite/views/staff/index.py
parentA wizard is never late, nor is he early. (diff)
Initial project layout for django
Diffstat (limited to 'pysite/views/staff/index.py')
-rw-r--r--pysite/views/staff/index.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/pysite/views/staff/index.py b/pysite/views/staff/index.py
deleted file mode 100644
index a090ebdd..00000000
--- a/pysite/views/staff/index.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from pprint import pformat
-
-from flask import current_app
-
-from pysite.base_route import RouteView
-from pysite.constants import ALL_STAFF_ROLES, DEBUG_MODE, TABLE_MANAGER_ROLES
-from pysite.decorators import require_roles
-
-
-class StaffView(RouteView):
- path = "/"
- name = "index"
-
- @require_roles(*ALL_STAFF_ROLES)
- def get(self):
- return self.render(
- "staff/index.html", manager=self.is_table_editor(),
- app_config=pformat(current_app.config, indent=4, width=120)
- )
-
- def is_table_editor(self):
- if DEBUG_MODE:
- return True
-
- data = self.user_data
-
- for role in TABLE_MANAGER_ROLES:
- if role in data.get("roles", []):
- return True
-
- return False