From 39985ebdd1deef33a2f134bef50d7d426b6ad57c Mon Sep 17 00:00:00 2001 From: kkthxbye-code Date: Thu, 5 Jan 2023 11:42:28 +0100 Subject: [PATCH] Fix exception when scheduling a job in the past --- netbox/extras/forms/scripts.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/netbox/extras/forms/scripts.py b/netbox/extras/forms/scripts.py index 58388e247..e61bb111d 100644 --- a/netbox/extras/forms/scripts.py +++ b/netbox/extras/forms/scripts.py @@ -48,9 +48,7 @@ class ScriptForm(BootstrapMixin, forms.Form): def clean__schedule_at(self): scheduled_time = self.cleaned_data['_schedule_at'] if scheduled_time and scheduled_time < timezone.now(): - raise forms.ValidationError({ - '_schedule_at': _('Scheduled time must be in the future.') - }) + raise forms.ValidationError(_('Scheduled time must be in the future.')) return scheduled_time