anonymous user cannot save favorite
This commit is contained in:
@@ -260,8 +260,12 @@ from utils import geo_distance,serialize_list,deserialize_list
|
|||||||
|
|
||||||
# Check if a user is a Coach member
|
# Check if a user is a Coach member
|
||||||
def iscoachmember(user):
|
def iscoachmember(user):
|
||||||
|
if not user.is_anonymous():
|
||||||
r = Rower.objects.get(user=user)
|
r = Rower.objects.get(user=user)
|
||||||
result = user.is_authenticated() and (r.rowerplan=='coach')
|
result = user.is_authenticated() and (r.rowerplan=='coach')
|
||||||
|
else:
|
||||||
|
result = False
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# Check if a user is a Pro member
|
# Check if a user is a Pro member
|
||||||
@@ -4198,6 +4202,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
|||||||
workstrokesonly = False
|
workstrokesonly = False
|
||||||
|
|
||||||
if request.method == 'POST' and 'savefavorite' in request.POST:
|
if request.method == 'POST' and 'savefavorite' in request.POST:
|
||||||
|
if not user.is_anonymous():
|
||||||
workstrokesonly = request.POST['workstrokesonlysave']
|
workstrokesonly = request.POST['workstrokesonlysave']
|
||||||
reststrokes = not workstrokesonly
|
reststrokes = not workstrokesonly
|
||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
|
|||||||
Reference in New Issue
Block a user