Projet

Général

Profil

0001-csvdatasource-do-not-validate-xls-xlsx-files-40704.patch

Thomas Noël, 23 avril 2020 11:45

Télécharger (1,21 ko)

Voir les différences:

Subject: [PATCH] csvdatasource: do not validate xls/xlsx files (#40704)

 passerelle/apps/csvdatasource/models.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
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
-