aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/mixins.py
diff options
context:
space:
mode:
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