mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Be more strict when verifying dtstart
This commit is contained in:
parent
a3ca786758
commit
96a4752f2f
@ -1330,8 +1330,8 @@ class ScheduleSerializer(BaseSerializer):
|
||||
# - BYWEEKNO
|
||||
def validate_rrule(self, attrs, source):
|
||||
rrule_value = attrs[source]
|
||||
if not 'dtstart' in rrule_value.lower():
|
||||
raise serializers.ValidationError('DTSTART required in rrule')
|
||||
if not re.match("DTSTART[\:\=][0-9]+T[0-9]+Z", rrule_value):
|
||||
raise serializers.ValidationError('DTSTART required in rrule, value should match: DTSTART:YYYYMMDDTHHMMSSZ')
|
||||
if not 'interval' in rrule_value.lower():
|
||||
raise serializers.ValidationError('INTERVAL required in rrule')
|
||||
if 'tzid' in rrule_value.lower():
|
||||
|
||||
@ -98,6 +98,6 @@ class Schedule(CommonModel):
|
||||
self.unified_job_template.update_computed_fields()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# Check if new rrule, if so set dtstart and dtend to null
|
||||
# TODO: Check if new rrule, if so set dtstart and dtend to null
|
||||
self.update_computed_fields()
|
||||
super(Schedule, self).save(*args, **kwargs)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user