[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

@@ -10,11 +10,11 @@ from django.forms import widgets
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as trans
from base import thread_local_middleware
from base.forms import Form
from base.methods import reload_queryset
from employee.forms import MultipleFileField
from employee.models import Employee
from horilla import horilla_middlewares
from payroll.context_processors import get_active_employees
from payroll.models.models import (
Contract,
@@ -34,7 +34,7 @@ class ModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
reload_queryset(self.fields)
request = getattr(thread_local_middleware._thread_locals, "request", None)
request = getattr(horilla_middlewares._thread_locals, "request", None)
for _, field in self.fields.items():
widget = field.widget