-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: before_first_request deprecation
- Loading branch information
1 parent
986e9ec
commit 5e6b665
Showing
3 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of Invenio. | ||
# Copyright (C) 2023 Graz University of Technology. | ||
# | ||
# Invenio is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Finalize app.""" | ||
|
||
|
||
def finalize_app(app): | ||
"""Finalize app.""" | ||
|
||
override_template_configuration(app) | ||
|
||
|
||
def override_template_configuration(app): | ||
"""Override template configuration.""" | ||
template_key = app.config.get( | ||
"OAUTHCLIENT_TEMPLATE_KEY", | ||
"SECURITY_LOGIN_USER_TEMPLATE", # default template key | ||
) | ||
if template_key is not None: | ||
template = app.config[template_key] # keep the old value | ||
app.config["OAUTHCLIENT_LOGIN_USER_TEMPLATE_PARENT"] = template | ||
app.config[template_key] = app.config.get( | ||
"OAUTHCLIENT_LOGIN_USER_TEMPLATE", | ||
"invenio_oauthclient/login_user.html", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters