diff --git a/bulletin/models.py b/bulletin/models.py index 43c5732..d017f04 100644 --- a/bulletin/models.py +++ b/bulletin/models.py @@ -8,23 +8,17 @@ from topics.models import Resource def validate_file_extension(value): valid_formats = [ - 'image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'application/vnd.ms-excel','text/html','application/msword','application/vnd.oasis.opendocument.presentation', - 'application/vnd.oasis.opendocument.spreadsheet','application/vnd.oasis.opendocument.text', - 'application/pdf' + 'application/vnd.ms-excel','application/vnd.oasis.opendocument.spreadsheet','text/csv' ] if hasattr(value.file, 'content_type'): if not value.file.content_type in valid_formats: - raise ValidationError(_('Please select a valid file. The uploaded file must have one of the following extensions: .doc, .docx, .html, .jpg, .odp, .ods, .odt, .pdf, .png, .ppt, .pptx, .xlx e .xlsx')) + raise ValidationError(_('Please select a valid file. The uploaded file must have one of the following extensions: .csv, .xlx, .xls and .xlsx')) class Bulletin(Resource): content = models.TextField(_('Bulletin Content'), blank = True) - file_content = models.FileField(_('File'), blank = True, upload_to = 'files/', validators = [validate_file_extension]) + file_content = models.FileField(_('Bulletin Data (Goals)'), blank = True, upload_to = 'files/', validators = [validate_file_extension]) class Meta: verbose_name = _('Bulletin') -- libgit2 0.21.2