Changeset 83759bf
- Timestamp:
- Apr 15, 2013, 4:21:26 AM (13 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- 52fb1d5
- Parents:
- a01934a
- git-author:
- Alex Dehnert <adehnert@…> (04/15/13 04:21:26)
- git-committer:
- Alex Dehnert <adehnert@…> (04/15/13 04:21:26)
- Location:
- asadb
- Files:
-
- 2 edited
-
forms/views.py (modified) (1 diff)
-
template/midway/upload.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
asadb/forms/views.py
r870992c r83759bf 630 630 631 631 class MidwayAssignmentsUploadForm(Form): 632 assignments = FileField() 632 def validate_csv_fields(upload_file): 633 reader = csv.reader(upload_file) 634 row = reader.next() 635 for col in ('Group', 'officers', 'Table', ): 636 if col not in row: 637 raise ValidationError('Please upload a CSV file with (at least) columns "Group", "officers", and "Table". (Missing at least "%s".)' % (col, )) 638 639 assignments = FileField(validators=[validate_csv_fields]) 633 640 634 641 @permission_required('forms.add_midwayassignment') -
asadb/template/midway/upload.html
r7d7801f r83759bf 46 46 <h2>Input</h2> 47 47 48 <p>Include columns "Group", "officers", and "Table". Matching is done on "Group", so try to ensure that your names match the database's.</p> 49 48 50 <form enctype="multipart/form-data" method="post" action=""> 49 51 {% csrf_token %}
Note: See TracChangeset
for help on using the changeset viewer.