1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-05-17 22:52:46 +00:00

Compare commits

..

No commits in common. "29d9432ca21669ec53c2a237a1bac787f47b5dd2" and "ec0419a6d793aab5fb8bbb64ac64f0a8ef31ac8e" have entirely different histories.

2 changed files with 2 additions and 10 deletions

View File

@ -262,15 +262,7 @@ class UploadNotesForm(forms.Form):
except UnicodeDecodeError: except UnicodeDecodeError:
# This is not UTF-8, grrrr # This is not UTF-8, grrrr
content = data.decode('latin1') content = data.decode('latin1')
for delimiter in [',', ';', '\t', '|']: csvfile = csv.reader(StringIO(content))
if content.split('\n')[0].count(delimiter) > 1:
break
else:
self.add_error('file',
_("Unable to detect the CSV delimiter. Please use a comma-separated file."))
return cleaned_data
csvfile = csv.reader(StringIO(content), delimiter=delimiter)
self.process(csvfile, cleaned_data) self.process(csvfile, cleaned_data)
except UnicodeDecodeError: except UnicodeDecodeError:
self.add_error('file', _("This file contains non-UTF-8 and non-ISO-8859-1 content. " self.add_error('file', _("This file contains non-UTF-8 and non-ISO-8859-1 content. "

View File

@ -863,7 +863,7 @@ class PoolDetailView(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context["passages"] = PassageTable(self.object.passages.order_by('position').all()) context["passages"] = PassageTable(self.object.passages.order_by('id').all())
if self.object.results_available or self.request.user.registration.is_volunteer: if self.object.results_available or self.request.user.registration.is_volunteer:
# Hide notes before the end of the turn # Hide notes before the end of the turn