From b618269fba2846790b44951ae77d284e0301f1ee Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 21 Mar 2017 13:07:04 -0300 Subject: [PATCH] Fixed error message in file_link creation --- file_link/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_link/models.py b/file_link/models.py index 018e36d..2604901 100644 --- a/file_link/models.py +++ b/file_link/models.py @@ -17,10 +17,10 @@ def validate_file_extension(value): 'application/vnd.oasis.opendocument.spreadsheet','application/vnd.oasis.opendocument.text', 'application/pdf' ] - + if hasattr(value.file, 'content_type'): if not value.file.content_type in valid_formats: - raise ValidationError(_('File not supported.')) + 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')) class FileLink(Resource): file_content = models.FileField(_('File'), blank = True, upload_to = 'files/', validators = [validate_file_extension]) -- libgit2 0.21.2