Private
Public Access
1
0

bug fixes

This commit is contained in:
Sander Roosendaal
2021-10-14 21:44:42 +02:00
parent de70931e58
commit 6d810b286b

View File

@@ -222,7 +222,8 @@ def course_view(request,id=0):
except GeoCourse.DoesNotExist: # pragma: no cover
raise Http404("Course doesn't exist")
r = getrower(request.user)
if request.user.is_authenticated:
r = getrower(request.user)
script,div = course_map(course)
@@ -232,7 +233,11 @@ def course_view(request,id=0):
workoutid__isnull=False,
coursecompleted=True).order_by("duration","-distance")
notsharing = Rower.objects.filter(share_course_results=False).exclude(id=r.id)
if request.user.is_authenticated:
notsharing = Rower.objects.filter(share_course_results=False).exclude(id=r.id)
else:
notsharing = Rower.objects.filter(share_course_results=False)
notsharing_ids = [o.user.id for o in notsharing]
records = records.exclude(userid__in=notsharing_ids)
@@ -242,7 +247,7 @@ def course_view(request,id=0):
if onlyme == 'true':
onlyme = True
if onlyme:
if onlyme and request.user.is_authenticated:
records = records.filter(userid=r.user.id)
else:
onlyme=False