- Timestamp:
- Mar 29, 2010, 4:37:59 AM (14 years ago)
- Branches:
- master, client
- Children:
- 80d1270
- Parents:
- f7dd5e7
- git-author:
- Alex Dehnert <adehnert@…> (03/29/10 04:37:59)
- git-committer:
- Alex Dehnert <adehnert@…> (03/29/10 04:37:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
remit/vouchers/views.py
rf7dd5e7 r0a5a003 54 54 55 55 class DocUploadForm(ModelForm): 56 def clean_backing_file(self, ): 57 f = self.cleaned_data['backing_file'] 58 ext = f.name.rsplit('.')[-1] 59 contenttype = f.content_type 60 if ext != 'pdf': 61 raise django.forms.ValidationError("Only PDF files are accepted --- you submitted a .%s file" % (ext, )) 62 elif contenttype != 'application/pdf': 63 raise django.forms.ValidationError("Only PDF files are accepted --- you submitted a %s file" % (contenttype, )) 64 else: 65 return f 66 56 67 class Meta: 57 68 model = Documentation
Note: See TracChangeset
for help on using the changeset viewer.