[FIX] PMS: Empty create issue

This commit is contained in:
Horilla
2024-03-11 09:49:09 +05:30
parent 13e4d52ef7
commit f71527ad6f

View File

@@ -287,6 +287,7 @@ def objective_list_view(request):
is_manager = Employee.objects.filter(
employee_work_info__reporting_manager_id=employee
)
template = "okr/okr_view.html"
if request.user.has_perm("pms.view_employeeobjective"):
objective_own = EmployeeObjective.objects.filter(employee_id=employee)
@@ -308,12 +309,6 @@ def objective_list_view(request):
objective_own = objective_own.distinct()
objective_all = EmployeeObjective.objects.none()
context = objective_filter_pagination(request, objective_own, objective_all)
if objective_all.exists() or objective_own.exists():
# template = "okr/objective_list_view.html"
template = "okr/okr_view.html"
else:
template = "okr/objective_empty.html"
return render(request, template, context)