templatetags: unlazy distance passed to |distance_filter (#46761)
This commit is contained in:
parent
508dc53c19
commit
fc70d15913
|
@ -566,6 +566,8 @@ def distance(obj1, obj2):
|
|||
|
||||
@register.filter
|
||||
def distance_filter(queryset, distance=1000):
|
||||
if hasattr(distance, 'get_value'):
|
||||
distance = distance.get_value() # unlazy
|
||||
return queryset.distance_filter(distance=int(distance))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue