bug fixes
This commit is contained in:
@@ -222,7 +222,8 @@ def course_view(request,id=0):
|
|||||||
except GeoCourse.DoesNotExist: # pragma: no cover
|
except GeoCourse.DoesNotExist: # pragma: no cover
|
||||||
raise Http404("Course doesn't exist")
|
raise Http404("Course doesn't exist")
|
||||||
|
|
||||||
r = getrower(request.user)
|
if request.user.is_authenticated:
|
||||||
|
r = getrower(request.user)
|
||||||
|
|
||||||
script,div = course_map(course)
|
script,div = course_map(course)
|
||||||
|
|
||||||
@@ -232,7 +233,11 @@ def course_view(request,id=0):
|
|||||||
workoutid__isnull=False,
|
workoutid__isnull=False,
|
||||||
coursecompleted=True).order_by("duration","-distance")
|
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]
|
notsharing_ids = [o.user.id for o in notsharing]
|
||||||
|
|
||||||
records = records.exclude(userid__in=notsharing_ids)
|
records = records.exclude(userid__in=notsharing_ids)
|
||||||
@@ -242,7 +247,7 @@ def course_view(request,id=0):
|
|||||||
if onlyme == 'true':
|
if onlyme == 'true':
|
||||||
onlyme = True
|
onlyme = True
|
||||||
|
|
||||||
if onlyme:
|
if onlyme and request.user.is_authenticated:
|
||||||
records = records.filter(userid=r.user.id)
|
records = records.filter(userid=r.user.id)
|
||||||
else:
|
else:
|
||||||
onlyme=False
|
onlyme=False
|
||||||
|
|||||||
Reference in New Issue
Block a user