[FIX] PERFORMANCE: Multiple-select2 issue

This commit is contained in:
Horilla
2023-12-13 19:12:42 +05:30
parent 0bc1e19e76
commit 6ffef1680e

View File

@@ -12,7 +12,7 @@ from django.db.models.base import Model
from django.forms.utils import ErrorList
from django.utils.translation import gettext_lazy as _
from employee.models import Department, JobPosition
from base.forms import ModelForm
from django.forms import ModelForm
from pms.models import (
Question,
EmployeeObjective,
@@ -514,6 +514,9 @@ class QuestionTemplateForm(ModelForm):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
reload_queryset(self.fields)
self.fields["company_id"].widget.attrs.update({
"class": "oh-select oh-select-2 w-100",
})
class QuestionForm(ModelForm):
@@ -663,6 +666,9 @@ class PeriodForm(ModelForm):
kwargs["initial"] = set_date_field_initial(instance)
super().__init__(*args, **kwargs)
reload_queryset(self.fields)
self.fields["company_id"].widget.attrs.update({
"class": "oh-select oh-select-2 w-100",
})
def clean(self):
cleaned_data = super().clean()