Ver Fonte

Fix exception when scheduling a job in the past

kkthxbye-code há 3 anos atrás
pai
commit
39985ebdd1
1 ficheiros alterados com 1 adições e 3 exclusões
  1. 1 3
      netbox/extras/forms/scripts.py

+ 1 - 3
netbox/extras/forms/scripts.py

@@ -48,9 +48,7 @@ class ScriptForm(BootstrapMixin, forms.Form):
     def clean__schedule_at(self):
     def clean__schedule_at(self):
         scheduled_time = self.cleaned_data['_schedule_at']
         scheduled_time = self.cleaned_data['_schedule_at']
         if scheduled_time and scheduled_time < timezone.now():
         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
         return scheduled_time