[FIX] LEAVE: Restrict leave for superuser fix

This commit is contained in:
Horilla
2024-10-03 15:04:43 +05:30
parent eede3b09c3
commit 6c505236b5

View File

@@ -742,7 +742,7 @@ class LeaveRequest(HorillaModel):
if EmployeePastLeaveRestrict.objects.first().enabled:
if self.start_date < date.today():
raise ValidationError(_("Requests cannot be made for past dates."))
if request.user.is_superuser:
if not request.user.is_superuser:
for restrict in restricted_leave:
restri = restrict.id