[UPDT] BASE: Updated base app by changing ThreadLocalMiddleware location to horilla project folder

This commit is contained in:
Horilla
2024-06-20 11:45:55 +05:30
parent 7f5814c4b7
commit ce5dcbe2a8
33 changed files with 90 additions and 207 deletions

View File

@@ -32,10 +32,10 @@ from django.forms import DateInput, ValidationError
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from base import thread_local_middleware
from base.methods import reload_queryset
from employee.filters import EmployeeFilter
from employee.models import Employee, EmployeeBankDetails
from horilla import horilla_middlewares
from horilla_widgets.widgets.horilla_multi_select_field import HorillaMultiSelectField
from horilla_widgets.widgets.select_widgets import HorillaMultiSelectWidget
from onboarding.models import CandidateTask, OnboardingStage, OnboardingTask
@@ -49,7 +49,7 @@ class ModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
request = getattr(thread_local_middleware._thread_locals, "request", None)
request = getattr(horilla_middlewares._thread_locals, "request", None)
reload_queryset(self.fields)
for _, field in self.fields.items():
widget = field.widget