diff --git a/invenio_config_tuw/config.py b/invenio_config_tuw/config.py index fc913aa861ee5d03b68778e82f59c73cfd1cf24f..d248c74560672f0ab2d56cf0250cecd6a5411f56 100644 --- a/invenio_config_tuw/config.py +++ b/invenio_config_tuw/config.py @@ -52,6 +52,9 @@ CONFIG_TUW_READ_ONLY_MODE = False CONFIG_TUW_DISABLE_ERROR_MAILS = False """Disable registration of the SMTP mail handler to suppress warnings.""" +CONFIG_TUW_MINIFY_ENABLED = False +"""Enable or disable the Flask-Minify extension.""" + # Invenio-Mail # ============ diff --git a/invenio_config_tuw/ext.py b/invenio_config_tuw/ext.py index a9ffba50f23e97c2341da82d90af63d11aeba6ad..fd7789b213f3ae4ed903a31c90c1f2020842de56 100644 --- a/invenio_config_tuw/ext.py +++ b/invenio_config_tuw/ext.py @@ -78,7 +78,12 @@ class InvenioConfigTUW(object): app.config[key] = app.config["DATACITE_USERNAME"] def init_minify(self, app): - """Initialize the Flask-Minify extension.""" - if "flask-minify" not in app.extensions: + """Initialize the Flask-Minify extension. + + It seems like this extension may cause issues with certain user-related + operations in the system and has thus been disabled by default. + """ + minify_enabled = app.config.get("CONFIG_TUW_MINIFY_ENABLED", False) + if minify_enabled and "flask-minify" not in app.extensions: minify = Minify(app, static=False, go=False) app.extensions["flask-minify"] = minify