mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 15:11:27 +00:00
fix: improve crontab validation logic
This commit is contained in:
@@ -189,8 +189,8 @@ class PeriodTaskSerializerMixin(serializers.Serializer):
|
||||
msg = _('* Please enter a valid crontab expression')
|
||||
raise serializers.ValidationError(msg)
|
||||
|
||||
crontab = crontab.strip().split()
|
||||
if '*' in crontab[0]:
|
||||
crontab = crontab.strip()
|
||||
if crontab.startswith('*'):
|
||||
raise serializers.ValidationError(_("Crontab minute must not contain '*'"))
|
||||
return crontab
|
||||
|
||||
|
Reference in New Issue
Block a user