[FIX] LEAVE: Fixed leave restriction in fresh db (#312)

This commit is contained in:
Horilla
2024-09-03 17:14:17 +05:30
parent f3aa988885
commit d1ffadc7e4

View File

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