diff options
author | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-03-28 18:37:13 +0100 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-03-28 18:37:13 +0100 |
commit | ef416856fd87d37e93ce172a43c9ef85beab308d (patch) | |
tree | 9cd7ccd99477d2de960d87e311972713fbd44024 /accounts/utils | |
parent | c387b99654ab37257441dab9927c14f07c05e219 (diff) | |
download | web-ef416856fd87d37e93ce172a43c9ef85beab308d.tar.gz web-ef416856fd87d37e93ce172a43c9ef85beab308d.tar.bz2 web-ef416856fd87d37e93ce172a43c9ef85beab308d.zip |
Port away from flask-script
Diffstat (limited to 'accounts/utils')
-rw-r--r-- | accounts/utils/console.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/accounts/utils/console.py b/accounts/utils/console.py index ef8b4fd..c63480a 100644 --- a/accounts/utils/console.py +++ b/accounts/utils/console.py @@ -1,22 +1,4 @@ # -*- coding: utf-8 -*- -import flask_script as script - - -class Command(script.Command): - """ - This changes the Command class from Flask-Script in such way, - that url_for will generate correct urls. - """ - - def __call__(self, app=None, *args, **kwargs): - base_url = '%s://%s%s' % ( - app.config.get('PREFERRED_URL_SCHEME') or 'http', - app.config.get('SERVER_NAME') or 'localhost', - app.config.get('APPLICATION_ROOT') or '/') - - with app.test_request_context(base_url=base_url): - return self.run(*args, **kwargs) - class TablePrinter(object): @@ -80,7 +62,7 @@ class ConsoleForm(object): _ready = False def __init__(self, formcls, **kwargs): - self.form = formcls() + self.form = formcls(meta={'csrf': False}) self._fill(kwargs) self._ready = True |