mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add error handling for read-only database mode in instances action
This commit is contained in:
parent
3e584f3df9
commit
c32f1c10a6
1 changed files with 3 additions and 0 deletions
|
|
@ -69,6 +69,9 @@ def instances_new():
|
|||
@instances.route("/instances/<string:action>", methods=["POST"])
|
||||
@login_required
|
||||
def instances_action(action: Literal["ping", "reload", "stop", "delete"]): # TODO: see if we can support start and restart
|
||||
if DB.readonly:
|
||||
return handle_error("Database is in read-only mode", "instances")
|
||||
|
||||
verify_data_in_form(
|
||||
data={"instances": None},
|
||||
err_message=f"Missing instances parameter on /instances/{action}.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue