[FIX] ACCESSIBILITY: Typo in naming
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
employee/decorators.py
|
||||
"""
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import redirect
|
||||
from accessibility.methods import check_is_accessibile
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from accessibility.methods import check_is_accessible
|
||||
from base.decorators import decorator_with_arguments
|
||||
|
||||
|
||||
@@ -28,7 +29,7 @@ def enter_if_accessible(function, feature, perm=None, method=None):
|
||||
cache_key = request.session.session_key + "accessibility_filter"
|
||||
employee = getattr(request.user, "employee_get")
|
||||
if employee:
|
||||
accessible = check_is_accessibile(feature, cache_key, employee)
|
||||
accessible = check_is_accessible(feature, cache_key, employee)
|
||||
has_perm = True
|
||||
if perm:
|
||||
has_perm = request.user.has_perm(perm)
|
||||
|
||||
@@ -3,12 +3,13 @@ accessibility/methods.py
|
||||
"""
|
||||
|
||||
from django.core.cache import cache
|
||||
from horilla.horilla_middlewares import _thread_locals
|
||||
from accessibility.models import DefaultAccessibility
|
||||
|
||||
from accessibility.filters import AccessibilityFilter
|
||||
from accessibility.models import DefaultAccessibility
|
||||
from horilla.horilla_middlewares import _thread_locals
|
||||
|
||||
|
||||
def check_is_accessibile(feature, cache_key, employee):
|
||||
def check_is_accessible(feature, cache_key, employee):
|
||||
"""
|
||||
Method to check the employee is accessible for the feature or not
|
||||
"""
|
||||
@@ -26,5 +27,5 @@ def check_is_accessibile(feature, cache_key, employee):
|
||||
|
||||
filter = accessibility.filter
|
||||
employees = AccessibilityFilter(data=filter).qs
|
||||
accessibile = employee in employees
|
||||
return accessibile
|
||||
accessible = employee in employees
|
||||
return accessible
|
||||
|
||||
@@ -3,8 +3,9 @@ accessibility/middlewares.py
|
||||
"""
|
||||
|
||||
from django.core.cache import cache
|
||||
|
||||
from accessibility.methods import check_is_accessible
|
||||
from accessibility.models import ACCESSBILITY_FEATURE
|
||||
from accessibility.methods import check_is_accessibile
|
||||
|
||||
ACCESSIBILITY_CACHE_USER_KEYS = {}
|
||||
|
||||
@@ -15,7 +16,7 @@ def update_accessibility_cache(cache_key, request):
|
||||
"""
|
||||
feature_accessible = {}
|
||||
for accessibility, _display in ACCESSBILITY_FEATURE:
|
||||
feature_accessible[accessibility] = check_is_accessibile(
|
||||
feature_accessible[accessibility] = check_is_accessible(
|
||||
accessibility, cache_key, getattr(request.user, "employee_get")
|
||||
)
|
||||
cache.set(cache_key, feature_accessible)
|
||||
|
||||
@@ -7,7 +7,7 @@ To set Horilla sidebar for employee
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as trans
|
||||
|
||||
from accessibility.methods import check_is_accessibile
|
||||
from accessibility.methods import check_is_accessible
|
||||
from base.templatetags.basefilters import is_reportingmanager
|
||||
|
||||
MENU = trans("Employee")
|
||||
@@ -99,5 +99,5 @@ def employee_accessibility(request, submenu, user_perms, *args, **kwargs):
|
||||
return (
|
||||
is_reportingmanager(request.user)
|
||||
or request.user.has_perm("employee.view_employee")
|
||||
or check_is_accessibile("employee_view", cache_key, employee)
|
||||
or check_is_accessible("employee_view", cache_key, employee)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user