mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
remove schedule import from servers
This commit is contained in:
parent
ef4a31d1e8
commit
210b831a47
@ -31,7 +31,6 @@ logger = logging.getLogger(__name__)
|
||||
try:
|
||||
import psutil
|
||||
#import pexpect
|
||||
import schedule
|
||||
|
||||
except ModuleNotFoundError as e:
|
||||
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True)
|
||||
|
@ -11,6 +11,7 @@ import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import threading
|
||||
from cron_validator import CronValidator
|
||||
|
||||
from tornado import locale
|
||||
from tornado import iostream
|
||||
@ -991,9 +992,10 @@ class PanelHandler(BaseHandler):
|
||||
else:
|
||||
interval_type = ''
|
||||
cron_string = bleach.clean(self.get_argument('cron', ''))
|
||||
cron_split = cron_string.split(' ')
|
||||
if len(cron_split) != 5:
|
||||
self.redirect("/panel/error?error=INVALID FORMAT: Invalid Cron Format. Cron must have a space between each character and only have a max of 5 characters * * * * *")
|
||||
try:
|
||||
CronValidator.parse(cron_string)
|
||||
except Exception as e:
|
||||
self.redirect("/panel/error?error=INVALID FORMAT: Invalid Cron Format. {}".format(e))
|
||||
return
|
||||
action = bleach.clean(self.get_argument('action', None))
|
||||
if action == "command":
|
||||
|
Loading…
Reference in New Issue
Block a user