[FIX] PMS: Fixed meetings can be created in past dates
This commit is contained in:
@@ -1043,6 +1043,13 @@ class MeetingsForm(BaseForm):
|
||||
ids = self.data.getlist("employee_id")
|
||||
if ids:
|
||||
self.errors.pop("employee_id", None)
|
||||
|
||||
if (
|
||||
cleaned_data["date"].date() <= datetime.datetime.now().date()
|
||||
and cleaned_data["date"].time() < datetime.datetime.now().time()
|
||||
):
|
||||
raise ValidationError("Date and time cannot be in the past")
|
||||
|
||||
return cleaned_data
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user