fix: Make Search and Search subscription are not the same if Search is not localized
This commit is contained in:
parent
bae4ee3d22
commit
9e1ec1711b
@ -40,6 +40,8 @@ class Search:
|
|||||||
|
|
||||||
Only allowed to be called for located subscriptions
|
Only allowed to be called for located subscriptions
|
||||||
"""
|
"""
|
||||||
|
if self.location is None:
|
||||||
|
return False
|
||||||
return self.location.name == other.location.name and self.sex == other.sex and self.max_distance == other.max_distance
|
return self.location.name == other.location.name and self.sex == other.sex and self.max_distance == other.max_distance
|
||||||
|
|
||||||
def _locate(self):
|
def _locate(self):
|
||||||
@ -106,7 +108,7 @@ class Search:
|
|||||||
SearchSubscription.objects.create(owner=user,
|
SearchSubscription.objects.create(owner=user,
|
||||||
location=self.location,
|
location=self.location,
|
||||||
sex=self.sex,
|
sex=self.sex,
|
||||||
radius=self.max_distance)
|
max_distance=self.max_distance)
|
||||||
|
|
||||||
def is_subscribed(self, user):
|
def is_subscribed(self, user):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user