Allow HyperPlanning import with a .txt file

This commit is contained in:
Claude Paroz 2017-07-18 09:59:06 +02:00
parent 76266d8e72
commit 07efab5154
2 changed files with 1 additions and 1 deletions

View file

@ -291,7 +291,7 @@ class ImportViewBase(FormView):
def form_valid(self, form):
upfile = form.cleaned_data['upload']
try:
if 'csv' in upfile.content_type:
if 'csv' in upfile.content_type or upfile.content_type == 'text/plain':
# Reopen the file in text mode
upfile = open(upfile.temporary_file_path(), mode='r', encoding='utf-8-sig')
imp_file = CSVImportedFile(File(upfile))