mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-05-17 10:52:47 +00:00
Compare commits
2 Commits
ec0419a6d7
...
29d9432ca2
Author | SHA1 | Date | |
---|---|---|---|
|
29d9432ca2 | ||
|
0181a1392d |
@ -262,7 +262,15 @@ 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')
|
||||||
csvfile = csv.reader(StringIO(content))
|
for delimiter in [',', ';', '\t', '|']:
|
||||||
|
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. "
|
||||||
|
@ -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('id').all())
|
context["passages"] = PassageTable(self.object.passages.order_by('position').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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user