1
0
Fork 0
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:
Sean Morley 2024-08-23 18:41:59 -04:00
parent c13d6f4f21
commit dab6efbe32
2 changed files with 26 additions and 1 deletions

View file

@ -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: