Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
restrict import
Browse files Browse the repository at this point in the history
  • Loading branch information
ftrabucchi-eab committed Jan 3, 2018
1 parent 4ef9e26 commit 7eb0413
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scheduler/forms.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django import forms
from django.utils import timezone
from django.forms import ModelForm, ValidationError
from django.utils.timezone import now


class JobAdminForm(forms.ModelForm):
class JobAdminForm(ModelForm):

def clean_scheduled_time(self):
data = self.cleaned_data['scheduled_time']
if data < timezone.now():
raise forms.ValidationError("Scheduled time has to be in the future")
if data < now():
raise ValidationError("Scheduled time has to be in the future")
return data

0 comments on commit 7eb0413

Please sign in to comment.