mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-29 04:09:07 -04:00
Only check on csv is the file extension.
Update validator logic Update message for the validator.
This commit is contained in:
@@ -20,8 +20,8 @@ class CsvFileValidator(object):
|
||||
self.message = message
|
||||
|
||||
def __call__(self, form, field):
|
||||
if not form.file.data.mimetype == 'text/csv':
|
||||
raise ValidationError(self.message)
|
||||
if not field.data.filename.lower().endswith('.csv'):
|
||||
raise ValidationError("{} is not a CSV file".format(field.data.filename))
|
||||
|
||||
|
||||
class ValidEmailDomainRegex(object):
|
||||
|
||||
Reference in New Issue
Block a user