adds sane delimiters for dialect detection #13239

This commit is contained in:
Abhimanyu Saharan 2023-08-25 18:26:07 +05:30
parent e782077bb7
commit e465a758f0

View File

@ -95,7 +95,7 @@ class BulkImportForm(BootstrapMixin, SyncedDataMixin, forms.Form):
try: try:
# This uses a rough heuristic to detect the CSV dialect. If the data is malformed, we'll fall back to # This uses a rough heuristic to detect the CSV dialect. If the data is malformed, we'll fall back to
# the default Excel dialect. # the default Excel dialect.
dialect = csv.Sniffer().sniff(data.strip()) dialect = csv.Sniffer().sniff(data.strip(), delimiters=',; ')
except csv.Error: except csv.Error:
dialect = csv.excel dialect = csv.excel