feat: streamline search_from pattern

This commit is contained in:
moanos [he/him] 2025-01-01 17:22:26 +01:00
parent b6fc5c634f
commit 7035b1642e

View File

@ -103,16 +103,11 @@ class Search:
else: else:
self.search_form = AdoptionNoticeSearchForm() self.search_form = AdoptionNoticeSearchForm()
@staticmethod def search_from_search_subscription(self, search_subscription: SearchSubscription):
def search_from_search_subscription(search_subscription: SearchSubscription): self.sex = search_subscription.sex
search = Search() self.location = search_subscription.location
search.sex = search_subscription.sex self.area_search = True
search.location = search_subscription.location self.max_distance = search_subscription.max_distance
search.area_search = True
search.max_distance = search_subscription.max_distance
return search
def subscribe(self, user): def subscribe(self, user):