diff options
| author | 2018-04-08 01:07:41 +0100 | |
|---|---|---|
| committer | 2018-04-08 01:07:41 +0100 | |
| commit | 8235adbecdf09ffe2e8b7a04a38d0be2d86fd5d4 (patch) | |
| tree | c126eef18d6bb10306d577bb5673a1f2a1bb2e88 /pysite/mixins.py | |
| parent | [Wiki] Shorten edit/view links in sidebar (diff) | |
Easier debugging and optimised imports
Simply set FLASK_DEBUG=1 in your env to skip OAuth checks
Diffstat (limited to '')
| -rw-r--r-- | pysite/mixins.py | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/pysite/mixins.py b/pysite/mixins.py index c57ca85f..efbc2d0c 100644 --- a/pysite/mixins.py +++ b/pysite/mixins.py @@ -1,10 +1,10 @@  # coding=utf-8 -import os  from weakref import ref  from flask import Blueprint  from rethinkdb.ast import Table +from pysite.constants import DEBUG_MODE  from pysite.database import RethinkDB @@ -53,7 +53,7 @@ class DBMixin:          cls._db = ref(manager.db) -        if "FLASK_DEBUG" in os.environ: +        if DEBUG_MODE:              manager.db.create_table(cls.table_name, primary_key=cls.table_primary_key)      @property @@ -92,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 | 
