[FIX] LEAVE: Past leave restriction error when employee creating leave request

This commit is contained in:
Horilla
2024-07-23 11:11:09 +05:30
parent ba9c10b784
commit 9a4fdad68c

View File

@@ -0,0 +1,5 @@
from leave.models import EmployeePastLeaveRestrict
enabled_restriction = EmployeePastLeaveRestrict.objects.first()
if not enabled_restriction:
enabled_restriction = EmployeePastLeaveRestrict.objects.create(enabled=True)