mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bugfix/schedule-enable' into 'dev'
Fix enabling/disabling schedules from schedule list See merge request crafty-controller/crafty-4!606
This commit is contained in:
commit
be37f8f49e
@ -6,6 +6,7 @@ TBD
|
|||||||
- Include tzdata in Docker image ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/604))
|
- Include tzdata in Docker image ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/604))
|
||||||
- Fix text/formatting issue on server config page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/602))
|
- Fix text/formatting issue on server config page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/602))
|
||||||
- Bump required version of PyYAML to 6.0.1 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/609))
|
- Bump required version of PyYAML to 6.0.1 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/609))
|
||||||
|
- Fix enable/disable schedule toggles on schedule list ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/606))
|
||||||
### Tweaks
|
### Tweaks
|
||||||
- Add public status link to login ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/608))
|
- Add public status link to login ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/608))
|
||||||
### Lang
|
### Lang
|
||||||
|
@ -92,20 +92,21 @@ class ApiServersServerTasksIndexHandler(BaseApiHandler):
|
|||||||
data["start_time"] = "00:00"
|
data["start_time"] = "00:00"
|
||||||
|
|
||||||
# validate cron string
|
# validate cron string
|
||||||
if data["cron_string"] != "" and not croniter.is_valid(data["cron_string"]):
|
if "cron_string" in data:
|
||||||
return self.finish_json(
|
if data["cron_string"] != "" and not croniter.is_valid(data["cron_string"]):
|
||||||
405,
|
return self.finish_json(
|
||||||
{
|
405,
|
||||||
"status": "error",
|
{
|
||||||
"error": self.helper.translation.translate(
|
"status": "error",
|
||||||
"error",
|
"error": self.helper.translation.translate(
|
||||||
"cronFormat",
|
"error",
|
||||||
self.controller.users.get_user_lang_by_id(
|
"cronFormat",
|
||||||
auth_data[4]["user_id"]
|
self.controller.users.get_user_lang_by_id(
|
||||||
|
auth_data[4]["user_id"]
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
},
|
||||||
},
|
)
|
||||||
)
|
|
||||||
if "parent" not in data:
|
if "parent" not in data:
|
||||||
data["parent"] = None
|
data["parent"] = None
|
||||||
task_id = self.tasks_manager.schedule_job(data)
|
task_id = self.tasks_manager.schedule_job(data)
|
||||||
|
@ -136,20 +136,21 @@ class ApiServersServerTasksTaskIndexHandler(BaseApiHandler):
|
|||||||
data["parent"] = None
|
data["parent"] = None
|
||||||
|
|
||||||
data["server_id"] = server_id
|
data["server_id"] = server_id
|
||||||
if data["cron_string"] != "" and not croniter.is_valid(data["cron_string"]):
|
if "cron_string" in data:
|
||||||
return self.finish_json(
|
if data["cron_string"] != "" and not croniter.is_valid(data["cron_string"]):
|
||||||
405,
|
return self.finish_json(
|
||||||
{
|
405,
|
||||||
"status": "error",
|
{
|
||||||
"error": self.helper.translation.translate(
|
"status": "error",
|
||||||
"error",
|
"error": self.helper.translation.translate(
|
||||||
"cronFormat",
|
"error",
|
||||||
self.controller.users.get_user_lang_by_id(
|
"cronFormat",
|
||||||
auth_data[4]["user_id"]
|
self.controller.users.get_user_lang_by_id(
|
||||||
|
auth_data[4]["user_id"]
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
},
|
||||||
},
|
)
|
||||||
)
|
|
||||||
self.tasks_manager.update_job(task_id, data)
|
self.tasks_manager.update_job(task_id, data)
|
||||||
|
|
||||||
self.controller.management.add_to_audit_log(
|
self.controller.management.add_to_audit_log(
|
||||||
|
Loading…
Reference in New Issue
Block a user