Skip to content
Snippets Groups Projects
Commit f93773a2 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

filtering should be done via id

parent eaf91b57
No related branches found
No related tags found
1 merge request!305Resolve "Allow for adding modifying types of subjects"
Pipeline #38439 passed
......@@ -373,7 +373,7 @@ def get_subjects_filtered(subjects_to_be_filtered: QuerySet, filters) -> QuerySe
elif column == "flying_team":
result = result.filter(flying_team=value)
elif column == "type":
result = result.filter(type__name=value)
result = result.filter(type_id=value)
elif str(column).startswith("visit_"):
visit_number = get_visit_number_from_visit_x_string(column)
result = filter_by_visit(result, visit_number, value)
......
......@@ -448,8 +448,8 @@ class TestSubjectApi(LoggedInWithWorkerTestCase):
subject.type = get_patient_subject_type()
subject.save()
self.check_subject_filtered([["type", get_patient_subject_type().name]], [subject])
self.check_subject_filtered([["type", get_control_subject_type().name]], [])
self.check_subject_filtered([["type", get_patient_subject_type().id]], [subject])
self.check_subject_filtered([["type", get_control_subject_type().id]], [])
def test_subjects_filter_unknown(self):
subject = self.study_subject
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment