Skip to content

Commit

Permalink
fix: student autocomplete in training form
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Jan 8, 2025
1 parent 3ff1f9e commit b50fbd7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions adminpage/sport/admin/trainingAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@
from .site import site


class AutocompleteStudent:
model = Student


class TrainingFormWithCSV(forms.ModelForm):
attended_students = forms.ModelMultipleChoiceField(
required=False,
queryset=Student.objects.exclude(medical_group__name='Medical checkup not passed'),
error_messages={'invalid_choice': 'The student has not passed medical check-up yet!'},
widget=AutocompleteSelectMultiple(
AutocompleteStudent,
Attendance._meta.get_field('student'),
admin_site=site,
attrs={'data-width': '50%'}
),
Expand Down

0 comments on commit b50fbd7

Please sign in to comment.