fix profile-scoped backups and shared profile rules

This commit is contained in:
Mateusz Gruszczyński
2026-06-07 23:12:00 +02:00
parent 51e00a4e37
commit 8990f2b404
10 changed files with 264 additions and 86 deletions
+6 -3
View File
@@ -35,9 +35,12 @@ def operation_logs_settings_save():
profile = _active_profile_or_400()
if not profile:
return jsonify({"ok": False, "error": "No profile"}), 400
settings = operation_logs.save_settings(int(profile["id"]), request.get_json(silent=True) or {})
result = operation_logs.apply_retention(int(profile["id"]))
return ok({"settings": settings, "retention": result})
try:
settings = operation_logs.save_settings(int(profile["id"]), request.get_json(silent=True) or {})
result = operation_logs.apply_retention(int(profile["id"]))
return ok({"settings": settings, "retention": result})
except Exception as exc:
return jsonify({"ok": False, "error": str(exc)}), 403 if isinstance(exc, PermissionError) else 400
@bp.post("/operation-logs/clear")