diff --git a/src/fellchensammlung/tools/search.py b/src/fellchensammlung/tools/search.py index 546c081..68f9b7b 100644 --- a/src/fellchensammlung/tools/search.py +++ b/src/fellchensammlung/tools/search.py @@ -86,7 +86,7 @@ class AdoptionNoticeSearch: Returns true if there are any restrictions on which adoption notices are searched. If all adoption notices fit the search, return True """ - return self.sex is None and self.area_search is None + return self.sex is not None or self.area_search is not None def adoption_notice_fits_search(self, adoption_notice: AdoptionNotice): # Make sure sex is set and sex is not set to all (then it can be disregarded) diff --git a/src/tests/test_views/test_search.py b/src/tests/test_views/test_search.py index 4f885fc..29cfd39 100644 --- a/src/tests/test_views/test_search.py +++ b/src/tests/test_views/test_search.py @@ -106,5 +106,5 @@ class SearchTest(TestCase): # We can't use assertContains because TestAdoption3 will always be in response at is included in map # In order to test properly, we need to only care for the context that influences the list display an_names = [a.name for a in response.context["adoption_notices"]] - self.assertTrue("TestAdoption1" in an_names) # Adoption in Berlin - self.assertFalse("TestAdoption3" in an_names) # Adoption in Stuttgart + self.assertTrue("TestAdoption1" in an_names) # Adoption in Berlin should be included + self.assertFalse("TestAdoption3" in an_names) # Adoption in Stuttgart should not be included