mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 03:35:18 +02:00
Region check - frontend
This commit is contained in:
parent
c13d6f4f21
commit
dab6efbe32
2 changed files with 26 additions and 1 deletions
|
@ -54,7 +54,7 @@ class CountryViewSet(viewsets.ReadOnlyModelViewSet):
|
|||
# make a post action that will get all of the users adventures and check if the point is in any of the regions if so make a visited region object for that user if it does not already exist
|
||||
@action(detail=False, methods=['post'])
|
||||
def region_check_all_adventures(self, request):
|
||||
adventures = Adventure.objects.filter(user_id=request.user.id)
|
||||
adventures = Adventure.objects.filter(user_id=request.user.id, type='visited')
|
||||
count = 0
|
||||
for adventure in adventures:
|
||||
if adventure.latitude is not None and adventure.longitude is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue