From df2f172813b42e6c5cbfd7187afc8736eb502810 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Tue, 12 Sep 2023 19:57:39 +0800 Subject: [PATCH] Improved customuser admin.py --- stude/accounts/admin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stude/accounts/admin.py b/stude/accounts/admin.py index f2c6065..35d9593 100644 --- a/stude/accounts/admin.py +++ b/stude/accounts/admin.py @@ -13,9 +13,7 @@ class CustomUserForm(forms.ModelForm): super(CustomUserForm, self).__init__(*args, **kwargs) if self.instance: self.fields['subjects'].queryset = SubjectInstance.objects.filter( - course=self.instance.course).filter( - year_level=self.instance.year_level).filter( - semester=self.instance.semester) + course=self.instance.course) year_level = forms.ModelChoiceField( queryset=Year_Level.objects.all(), required=False)