fix: dont validate crontab in backend
This commit is contained in:
@@ -5,9 +5,6 @@ import tortoise.validators
|
|||||||
|
|
||||||
from app.models.base import AbstractModel
|
from app.models.base import AbstractModel
|
||||||
|
|
||||||
# https://stackoverflow.com/a/57639657
|
|
||||||
CRONTAB_REGEX = r"^(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})$"
|
|
||||||
|
|
||||||
|
|
||||||
class Task(AbstractModel):
|
class Task(AbstractModel):
|
||||||
list_name = tortoise.fields.CharField(max_length=128, db_index=True, null=False)
|
list_name = tortoise.fields.CharField(max_length=128, db_index=True, null=False)
|
||||||
@@ -15,7 +12,6 @@ class Task(AbstractModel):
|
|||||||
reset_cron = tortoise.fields.CharField(
|
reset_cron = tortoise.fields.CharField(
|
||||||
max_length=64,
|
max_length=64,
|
||||||
null=True,
|
null=True,
|
||||||
validators=[tortoise.validators.RegexValidator(CRONTAB_REGEX, 0)],
|
|
||||||
)
|
)
|
||||||
check_date = tortoise.fields.DatetimeField(null=True)
|
check_date = tortoise.fields.DatetimeField(null=True)
|
||||||
previous_check_date = tortoise.fields.DatetimeField(null=True)
|
previous_check_date = tortoise.fields.DatetimeField(null=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user