Private
Public Access
1
0

fix emailprocessing bug

This commit is contained in:
Sander Roosendaal
2020-10-10 09:33:43 +02:00
parent 3c99e59afb
commit b06cddd2c2

View File

@@ -4632,7 +4632,7 @@ def workout_upload_api(request):
q = request.POST
post_data = {k: q.getlist(k) if len(q.getlist(k))>1 else v for k, v in q.items()}
# only allow local host
hostt = request.get_host().split(':')
if hostt[0] not in ['localhost','127.0.0.1','dev.rowsandall.com','rowsandall.com']:
@@ -4697,9 +4697,10 @@ def workout_upload_api(request):
else:
r = None
for rwr in Rower.objects.all():
if post_data['useremail'] in rwr.emailalternatives:
r = rwr
break
if rwr.emailalternatives is not None:
if post_data['useremail'] in rwr.emailalternatives:
r = rwr
break
if post_data['useremail'] not in r.emailalternatives:
message = {'status':'false','message':'could not find user'}
return JSONResponse(status=400,data=message)