Changeset 83759bf for asadb/forms/views.py
- 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)
- File:
-
- 1 edited
-
asadb/forms/views.py (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')
Note: See TracChangeset
for help on using the changeset viewer.