mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add write test to UI as well
This commit is contained in:
parent
a2abe6811c
commit
fd0de70db6
1 changed files with 6 additions and 4 deletions
|
|
@ -445,11 +445,13 @@ def handle_csrf_error(_):
|
|||
|
||||
@app.before_request
|
||||
def before_request():
|
||||
try:
|
||||
db_user = app.config["DB"].get_ui_user()
|
||||
except BaseException:
|
||||
db_user = app.config["DB"].get_ui_user()
|
||||
if not app.config["DB"].readonly:
|
||||
try:
|
||||
app.config["DB"].test_write()
|
||||
except BaseException:
|
||||
app.config["DB"].readonly = True
|
||||
|
||||
db_user = app.config["DB"].get_ui_user()
|
||||
if db_user:
|
||||
app.config["USER"] = User(**db_user)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue