From 9e41d60a443e7a9229a5c855d4bdca33a6239520 Mon Sep 17 00:00:00 2001 From: Frank Yu Date: Sun, 22 Sep 2024 14:00:26 +0800 Subject: [PATCH] Remove unnecessary shell context --- greybook/__init__.py | 2 -- greybook/core/shell.py | 8 -------- 2 files changed, 10 deletions(-) delete mode 100644 greybook/core/shell.py diff --git a/greybook/__init__.py b/greybook/__init__.py index b0b92b3..e9e63b7 100644 --- a/greybook/__init__.py +++ b/greybook/__init__.py @@ -8,7 +8,6 @@ from greybook.core.extensions import bootstrap, ckeditor, csrf, db, login_manager, mail, migrate, toolbar from greybook.core.logging import register_logging from greybook.core.request import register_request_handlers -from greybook.core.shell import register_shell_handlers from greybook.core.templating import register_template_handlers from greybook.settings import config @@ -37,6 +36,5 @@ def create_app(config_name): register_errors(app) register_template_handlers(app) register_request_handlers(app) - register_shell_handlers(app) return app diff --git a/greybook/core/shell.py b/greybook/core/shell.py deleted file mode 100644 index f9c9bd0..0000000 --- a/greybook/core/shell.py +++ /dev/null @@ -1,8 +0,0 @@ -from greybook.core.extensions import db -from greybook.models import Admin, Category, Comment, Post - - -def register_shell_handlers(app): - @app.shell_context_processor - def make_shell_context(): - return dict(db=db, Admin=Admin, Post=Post, Category=Category, Comment=Comment)