bugfix promember check
This commit is contained in:
@@ -233,7 +233,11 @@ def handle_stravaexport(f2,workoutname,stravatoken,description=''):
|
|||||||
client = stravalib.Client(access_token=stravatoken)
|
client = stravalib.Client(access_token=stravatoken)
|
||||||
|
|
||||||
act = client.upload_activity(f2,'tcx',name=workoutname)
|
act = client.upload_activity(f2,'tcx',name=workoutname)
|
||||||
res = act.wait(poll_interval=5.0)
|
try:
|
||||||
|
res = act.wait(poll_interval=5.0)
|
||||||
|
except:
|
||||||
|
res = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# description doesn't work yet. Have to wait for stravalib to update
|
# description doesn't work yet. Have to wait for stravalib to update
|
||||||
|
|||||||
@@ -207,8 +207,11 @@ def iscoachmember(user):
|
|||||||
|
|
||||||
# Check if a user is a Pro member
|
# Check if a user is a Pro member
|
||||||
def ispromember(user):
|
def ispromember(user):
|
||||||
r = Rower.objects.get(user=user)
|
if not user.is_anonymous():
|
||||||
result = user.is_authenticated() and (r.rowerplan=='pro' or r.rowerplan=='coach')
|
r = Rower.objects.get(user=user)
|
||||||
|
result = user.is_authenticated() and (r.rowerplan=='pro' or r.rowerplan=='coach')
|
||||||
|
else:
|
||||||
|
result = False
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# User registration
|
# User registration
|
||||||
|
|||||||
Reference in New Issue
Block a user