aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/mixins.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-04-09 10:34:00 +0100
committerGravatar Gareth Coles <[email protected]>2018-04-09 10:34:00 +0100
commitafc30354493ef346138281c4115118b8b0dde01b (patch)
tree9e3ee401d89a461c2372d6f16aebf6baa6367feb /pysite/mixins.py
parentContribs too picky, need new payment logos (diff)
parentAdded Python 3 cheat sheet to resources.json (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'pysite/mixins.py')
-rw-r--r--pysite/mixins.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pysite/mixins.py b/pysite/mixins.py
index a2730ae4..efbc2d0c 100644
--- a/pysite/mixins.py
+++ b/pysite/mixins.py
@@ -4,6 +4,7 @@ from weakref import ref
from flask import Blueprint
from rethinkdb.ast import Table
+from pysite.constants import DEBUG_MODE
from pysite.database import RethinkDB
@@ -51,7 +52,9 @@ class DBMixin:
raise RuntimeError("Routes using DBViewMixin must define `table_name`")
cls._db = ref(manager.db)
- manager.db.create_table(cls.table_name, primary_key=cls.table_primary_key)
+
+ if DEBUG_MODE:
+ manager.db.create_table(cls.table_name, primary_key=cls.table_primary_key)
@property
def table(self) -> Table:
@@ -89,7 +92,6 @@ class OauthMixin:
@classmethod
def setup(cls: "OauthMixin", manager: "pysite.route_manager.RouteManager", blueprint: Blueprint):
-
if hasattr(super(), "setup"):
super().setup(manager, blueprint) # pragma: no cover