Incoporate PR feedback

This commit is contained in:
Jeremy Stretch
2026-04-16 15:15:48 -04:00
parent 508f9b3377
commit 6618e81da4
2 changed files with 9 additions and 1 deletions

View File

@@ -315,7 +315,7 @@ class Job(models.Model):
user=user,
job_id=uuid.uuid4(),
queue_name=rq_queue_name,
notifications=notifications or JobNotificationChoices.NOTIFICATION_ALWAYS
notifications=notifications if notifications is not None else JobNotificationChoices.NOTIFICATION_ALWAYS
)
job.full_clean()
job.save()

View File

@@ -120,6 +120,14 @@ class ScriptInputSerializer(serializers.Serializer):
default=JobNotificationChoices.NOTIFICATION_ALWAYS,
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Default to script's Meta.notifications_default if set
script = self.context.get('script')
if script and script.python_class:
self.fields['notifications'].default = script.python_class.notifications_default
def validate_schedule_at(self, value):
"""
Validates the specified schedule time for a script execution.