[FIX] ATTENDANCE: User permissions in hour account

This commit is contained in:
Horilla
2024-01-08 13:52:48 +05:30
parent 3e7e3b6755
commit ef6b5c4b36
2 changed files with 3 additions and 3 deletions

View File

@@ -27,7 +27,7 @@
<div class="oh-sticky-table__tbody">
{% for ot in accounts %}
{% with dates=ot.month_days %}
<div class="oh-sticky-table__tr" hx-get="{% url 'attendance-search' %}?employee_id={{ot.employee_id.id}}&attendance_validated=true&attendance_date__gte={{ dates.0|date:"Y-m-d" }}&attendance_date__lte={{ dates.1|date:"Y-m-d" }}" hx-target="#ot-table" draggable="true" onclick="hiding()">
<div class="oh-sticky-table__tr" {% if perms.attendance.view_attendance %} hx-get="{% url 'attendance-search' %}?employee_id={{ot.employee_id.id}}&attendance_validated=true&attendance_date__gte={{ dates.0|date:"Y-m-d" }}&attendance_date__lte={{ dates.1|date:"Y-m-d" }}" hx-target="#ot-table" onclick="hiding()"{% endif %} draggable="true" >
<div class="oh-sticky-table__sd" onclick="event.stopPropagation();">
<div class="centered-div">
<input

View File

@@ -29,7 +29,7 @@ from django.views.decorators.http import require_http_methods
from base.models import JobPosition
from notifications.signals import notify
from horilla import settings
from horilla.decorators import login_required, hx_request_required
from horilla.decorators import login_required, hx_request_required, manager_can_enter
from horilla.decorators import permission_required
from base.methods import generate_pdf, get_key_instances
from recruitment.models import Candidate, Recruitment, RecruitmentMailTemplate
@@ -408,7 +408,7 @@ def candidate_delete(request, obj_id):
@login_required
@permission_required("recruitment.view_candidate")
@manager_can_enter("onboarding.view_candidatestage")
def candidates_single_view(request, id, **kwargs):
"""
Candidate individual view for the onboarding candidates