Skip to content

Commit

Permalink
Removed unnecessary filter fields on the Applicants API and fixed som…
Browse files Browse the repository at this point in the history
…e other problems with it, resolving issue #182.
  • Loading branch information
filiptypjeu committed Jan 12, 2024
1 parent 6330f3f commit e3dd75b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion teknologr/api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ class ApplicantFilter(MemberFilter):
dead = None
bill_code = None
created = None
n_functionaries = None
n_groups = None
n_decorations = None

# Add all extra fields
motivation = django_filters.CharFilter(
Expand All @@ -344,4 +347,4 @@ class ApplicantFilter(MemberFilter):
lookup_expr='icontains',
label='Modersmålet innehåller',
)
created_at = django_filters.DateFromToRangeFilter(label='Ansökningsdatum är mellan')
created_at = django_filters.DateFromToRangeFilter(label='Ansökningsdatumet är mellan')
2 changes: 2 additions & 0 deletions teknologr/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ def to_representation(self, instance):
# Applicant

class ApplicantSerializer(BaseSerializer):
country = SerializableCountryField(allow_blank=True, choices=Countries(), required=False)

class Meta:
model = Applicant
fields = '__all__'

0 comments on commit e3dd75b

Please sign in to comment.