provide score when llocating people

This commit is contained in:
Laura Klünder 2019-12-28 17:18:32 +01:00
parent eecbf474df
commit 5e96d98693
2 changed files with 4 additions and 0 deletions

View file

@ -304,6 +304,8 @@ class CustomLocation:
('nearby', tuple(location.pk for location in self.nearby)),
('altitude', None if self.altitude is None else round(self.altitude, 2))
))
if hasattr(self, 'score'):
result['score'] = self.score
if not grid.enabled:
result.pop('grid_square')
if include_type:

View file

@ -91,6 +91,8 @@ class Locator:
best_location = location
best_score = score
best_location.score = best_score
return best_location