mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 17:55:29 +01:00
Merge branch 'bug/schedule-disable' into 'dev'
Fix scheduled task disable See merge request crafty-controller/crafty-4!478
This commit is contained in:
commit
7a81652395
@ -4,6 +4,7 @@
|
|||||||
TBD
|
TBD
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
- Fix conditional issue with zip imports/uploads ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/476))
|
- Fix conditional issue with zip imports/uploads ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/476))
|
||||||
|
- Fix API Schedule updates ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/478))
|
||||||
### Tweaks
|
### Tweaks
|
||||||
- Fix sidebar to not move when scrolling ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/475))
|
- Fix sidebar to not move when scrolling ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/475))
|
||||||
### Lang
|
### Lang
|
||||||
|
@ -436,6 +436,14 @@ class TasksManager:
|
|||||||
and "cron_string" in job_data
|
and "cron_string" in job_data
|
||||||
and "interval_type" in job_data
|
and "interval_type" in job_data
|
||||||
):
|
):
|
||||||
|
if not "enabled" in job_data:
|
||||||
|
return
|
||||||
|
|
||||||
|
if job_data["enabled"] is True:
|
||||||
|
job_data = HelpersManagement.get_scheduled_task(sch_id)
|
||||||
|
job_data["server_id"] = job_data["server_id"]["server_id"]
|
||||||
|
else:
|
||||||
|
self.scheduler.remove_job(str(sch_id))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -4,7 +4,6 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from jsonschema import ValidationError, validate
|
from jsonschema import ValidationError, validate
|
||||||
from app.classes.models.management import HelpersManagement
|
|
||||||
from app.classes.models.server_permissions import EnumPermissionsServer
|
from app.classes.models.server_permissions import EnumPermissionsServer
|
||||||
|
|
||||||
from app.classes.web.base_api_handler import BaseApiHandler
|
from app.classes.web.base_api_handler import BaseApiHandler
|
||||||
@ -97,7 +96,7 @@ class ApiServersServerTasksTaskIndexHandler(BaseApiHandler):
|
|||||||
if str(data.get("parent")) == str(task_id) and data.get("parent") is not None:
|
if str(data.get("parent")) == str(task_id) and data.get("parent") is not None:
|
||||||
data["parent"] = None
|
data["parent"] = None
|
||||||
|
|
||||||
HelpersManagement.update_scheduled_task(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(
|
||||||
auth_data[4]["user_id"],
|
auth_data[4]["user_id"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user