Skip to content

Commit

Permalink
Merge pull request #5254 from onepercentclub/hotfix/location-without-…
Browse files Browse the repository at this point in the history
…position

Fix user location missing position
  • Loading branch information
eodolphi committed Sep 23, 2022
2 parents f1661e9 + 2c26b24 commit 4939e96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bluebottle/activities/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,19 @@ def get_matching_properties(self, obj):
self.context['themes'] = [theme.pk for theme in user.favourite_themes.all()]

if 'location' not in self.context:
self.context['location'] = user.location or user.place
if user.location and user.location.position:
self.context['location'] = user.location

if user.place and user.place.position:
self.context['location'] = user.place

matching = {'location': False}
matching['skill'] = obj.expertise[0].id in self.context['skills'] if obj.expertise else False
matching['theme'] = obj.theme[0].id in self.context['themes'] if obj.theme else False

if obj.is_online:
matching['location'] = True
elif self.context['location'] and obj.position:
elif 'location' in self.context and obj.position:
positions = [obj.position] if 'lat' in obj.position else obj.position

dist = min(
Expand Down

0 comments on commit 4939e96

Please sign in to comment.