Adding Course Update
This commit is contained in:
@@ -5,7 +5,6 @@ import arrow
|
||||
import datetime
|
||||
|
||||
def save_scoring(name,user,filename,id=0,notes=""):
|
||||
print(notes)
|
||||
if id==0:
|
||||
collection = StandardCollection(name=name,manager=user,notes=notes)
|
||||
collection.save()
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="/rowers/standards/upload/{{ collection.id }}/">Update these Standard Times</a>
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
<h2>Standard Times</h2>
|
||||
<table class="listtable shortpadded" width="100%"?
|
||||
|
||||
@@ -204,6 +204,7 @@ urlpatterns = [
|
||||
re_path(r'^list-standards/$',views.standards_view,name='standards_view'),
|
||||
re_path(r'^courses/upload/$',views.course_upload_view,name='course_upload_view'),
|
||||
re_path(r'^standards/upload/$',views.standards_upload_view,name='standards_upload_view'),
|
||||
re_path(r'^standards/upload/(?P<id>\d+)/$',views.standards_upload_view,name='standards_upload_view'),
|
||||
re_path(r'^workout/addmanual/(?P<raceid>\d+)$',views.addmanual_view,name='addmanual_view'),
|
||||
re_path(r'^workout/addmanual/$',views.addmanual_view,name='addmanual_view'),
|
||||
re_path(r'^team-compare-select/workout/(?P<id>\d+)/team/(?P<teamid>\d+)/user/(?P<userid>\d+)/$',views.team_comparison_select,name='team_comparison_select'),
|
||||
|
||||
@@ -531,7 +531,6 @@ def standards_upload_view(request,id=0):
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
print(request.POST)
|
||||
form = StandardsForm(request.POST,request.FILES)
|
||||
|
||||
if form.is_valid():
|
||||
@@ -542,7 +541,7 @@ def standards_upload_view(request,id=0):
|
||||
filename,path_and_filename = handle_uploaded_file(f)
|
||||
|
||||
id = save_scoring(name,request.user,path_and_filename,notes=notes,id=id)
|
||||
print(notes)
|
||||
|
||||
|
||||
os.remove(path_and_filename)
|
||||
|
||||
@@ -567,7 +566,6 @@ def standards_upload_view(request,id=0):
|
||||
return HttpResponseRedirect(url)
|
||||
else:
|
||||
messages.error(request,'Form is not valid')
|
||||
print(form.errors)
|
||||
return render(request,'standard_form.html',
|
||||
{'form':form,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user