Private
Public Access
1
0

fix bug for team upload

This commit is contained in:
Sander Roosendaal
2019-09-03 21:22:34 +02:00
parent 9c8392d426
commit 7c77e87aa3

View File

@@ -4317,8 +4317,20 @@ def team_workout_upload_view(request,message="",
rowerform.fields['user'].queryset = User.objects.filter(rower__in=rowers).distinct()
if form.is_valid():
f = request.FILES['file']
res = handle_uploaded_file(f)
f = request.FILES.get('file',False)
if f:
res = handle_uploaded_file(f)
else:
messages.error(request,'No file attached')
response = render(request,
'team_document_form.html',
{'form':form,
'teams':get_my_teams(request.user),
'optionsform':optionsform,
'rowerform':rowerform,
})
return response
t = form.cleaned_data['title']
offline = form.cleaned_data['offline']
boattype = form.cleaned_data['boattype']