mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix general user backup path
This commit is contained in:
parent
1ba0520c0e
commit
86ecfc35b6
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
from jsonschema import validate
|
from jsonschema import validate
|
||||||
@ -97,6 +98,10 @@ class ApiServersServerBackupsIndexHandler(BaseApiHandler):
|
|||||||
if EnumPermissionsServer.BACKUP not in server_permissions:
|
if EnumPermissionsServer.BACKUP not in server_permissions:
|
||||||
# if the user doesn't have Schedule permission, return an error
|
# if the user doesn't have Schedule permission, return an error
|
||||||
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
||||||
|
# Set the backup location automatically for non-super users. We should probably
|
||||||
|
# make the default location configurable for SU eventually
|
||||||
|
if not auth_data[4]["superuser"]:
|
||||||
|
data["backup_location"] = os.path.join(self.helper.backup_path, server_id)
|
||||||
data["server_id"] = server_id
|
data["server_id"] = server_id
|
||||||
if not data.get("excluded_dirs", None):
|
if not data.get("excluded_dirs", None):
|
||||||
data["excluded_dirs"] = []
|
data["excluded_dirs"] = []
|
||||||
|
Loading…
Reference in New Issue
Block a user