0001-csvdatasource-do-not-validate-xls-xlsx-files-40704.patch
passerelle/apps/csvdatasource/models.py | ||
---|---|---|
158 | 158 |
self._detect_dialect_options() |
159 | 159 |
except Exception as e: |
160 | 160 |
raise ValidationError(_('Could not detect CSV dialect: %s') % e) |
161 |
try: |
|
162 |
self.get_rows() |
|
163 |
except Exception as e: |
|
164 |
raise ValidationError(_('Invalid CSV file: %s') % e) |
|
161 |
if file_type not in ('xls', 'xlsx'): |
|
162 |
try: |
|
163 |
self.get_rows() |
|
164 |
except Exception as e: |
|
165 |
raise ValidationError(_('Invalid CSV file: %s') % e) |
|
165 | 166 |
return super(CsvDataSource, self).clean(*args, **kwargs) |
166 | 167 | |
167 | 168 |
def _detect_dialect_options(self): |
168 |
- |