mirror of
https://github.com/ansible/awx.git
synced 2026-05-03 23:55:28 -02:30
don't allow rrule values that contain both COUNT and UNTIL
see: https://github.com/ansible/ansible-tower/issues/7887
This commit is contained in:
@@ -3887,6 +3887,7 @@ class SchedulePreviewSerializer(BaseSerializer):
|
||||
# - BYYEARDAY
|
||||
# - BYWEEKNO
|
||||
# - Multiple DTSTART or RRULE elements
|
||||
# - Can't contain both COUNT and UNTIL
|
||||
# - COUNT > 999
|
||||
def validate_rrule(self, value):
|
||||
rrule_value = value
|
||||
@@ -3921,6 +3922,8 @@ class SchedulePreviewSerializer(BaseSerializer):
|
||||
raise serializers.ValidationError(_("BYYEARDAY not supported."))
|
||||
if 'byweekno' in rrule_value.lower():
|
||||
raise serializers.ValidationError(_("BYWEEKNO not supported."))
|
||||
if 'COUNT' in rrule_value and 'UNTIL' in rrule_value:
|
||||
raise serializers.ValidationError(_("RRULE may not contain both COUNT and UNTIL"))
|
||||
if match_count:
|
||||
count_val = match_count.groups()[0].strip().split("=")
|
||||
if int(count_val[1]) > 999:
|
||||
|
||||
Reference in New Issue
Block a user