mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Add SAFE_MODE concept to let tests run without plugins (#753)
* Adds a `SAFE_MODE` config to disable the loading of plugins.
This commit is contained in:
@@ -189,6 +189,7 @@ def create_app(config='CTFd.config.Config'):
|
|||||||
app.register_error_handler(500, general_error)
|
app.register_error_handler(500, general_error)
|
||||||
app.register_error_handler(502, gateway_error)
|
app.register_error_handler(502, gateway_error)
|
||||||
|
|
||||||
|
if app.config.get('SAFE_MODE', False):
|
||||||
init_plugins(app)
|
init_plugins(app)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
@@ -210,3 +210,4 @@ class TestingConfig(Config):
|
|||||||
UPDATE_CHECK = False
|
UPDATE_CHECK = False
|
||||||
REDIS_URL = None
|
REDIS_URL = None
|
||||||
CACHE_TYPE = 'simple'
|
CACHE_TYPE = 'simple'
|
||||||
|
SAFE_MODE = True
|
||||||
|
|||||||
Reference in New Issue
Block a user