Misc cleanup

This commit is contained in:
Jeremy Stretch 2024-07-18 16:44:26 -04:00
parent 00dc9c464b
commit d3668ce328
2 changed files with 1 additions and 7 deletions

View File

@ -125,12 +125,6 @@ class EventRule(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin, ChangeLogged
def clean(self):
super().clean()
# At least one action type must be selected
if not self.event_types:
raise ValidationError(
_("At least one event type must be selected: create, update, delete, job start, and/or job end.")
)
# Validate that any conditions are in the correct format
if self.conditions:
try:

View File

@ -298,7 +298,7 @@ class ConditionSetTest(TestCase):
webhook = Webhook.objects.create(name='Webhook 100', payload_url='http://example.com/?1', http_method='POST')
form = EventRuleForm({
"name": "Event Rule 1",
'event_types': [OBJECT_CREATED, OBJECT_UPDATED],
"event_types": [OBJECT_CREATED, OBJECT_UPDATED],
"action_object_type": ct.pk,
"action_type": "webhook",
"action_choice": webhook.pk,