On consolide la recherche (erreur 500 des moteurs de recherche)
This commit is contained in:
parent
ced15d5113
commit
f7f8d9cb0c
@ -137,7 +137,11 @@ class EventFilter(django_filters.FilterSet):
|
||||
if self.get_cleaned_data("position") is None or self.get_cleaned_data("radius") is None:
|
||||
return parent
|
||||
d = self.get_cleaned_data("radius")
|
||||
p = self.get_cleaned_data("position").location
|
||||
p = self.get_cleaned_data("position")
|
||||
if not isinstance(d, str) or not isinstance(p, ReferenceLocation):
|
||||
return parent
|
||||
p = p.location
|
||||
|
||||
return parent.exclude(exact_location=False).filter(exact_location__location__distance_lt=(p, D(km=d)))
|
||||
|
||||
def get_url(self):
|
||||
@ -188,6 +192,7 @@ class EventFilter(django_filters.FilterSet):
|
||||
|
||||
|
||||
def get_cleaned_data(self, name):
|
||||
|
||||
try:
|
||||
return self.form.cleaned_data[name]
|
||||
except AttributeError:
|
||||
|
Loading…
Reference in New Issue
Block a user