From 7035b1642e35c45bcd4fb7c3369d0c2afb42df34 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 1 Jan 2025 17:22:26 +0100 Subject: [PATCH] feat: streamline search_from pattern --- src/fellchensammlung/tools/search.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/fellchensammlung/tools/search.py b/src/fellchensammlung/tools/search.py index 5afe272..ff60047 100644 --- a/src/fellchensammlung/tools/search.py +++ b/src/fellchensammlung/tools/search.py @@ -103,16 +103,11 @@ class Search: else: self.search_form = AdoptionNoticeSearchForm() - @staticmethod - def search_from_search_subscription(search_subscription: SearchSubscription): - search = Search() - search.sex = search_subscription.sex - search.location = search_subscription.location - search.area_search = True - search.max_distance = search_subscription.max_distance - - - return search + def search_from_search_subscription(self, search_subscription: SearchSubscription): + self.sex = search_subscription.sex + self.location = search_subscription.location + self.area_search = True + self.max_distance = search_subscription.max_distance def subscribe(self, user):