aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--management/parsers/ups2018.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/management/parsers/ups2018.py b/management/parsers/ups2018.py
index 15c629a..4ae7ef7 100644
--- a/management/parsers/ups2018.py
+++ b/management/parsers/ups2018.py
@@ -14,6 +14,7 @@
# along with celcatsanitizer. If not, see <http://www.gnu.org/licenses/>.
from datetime import datetime, timedelta
+from collections import OrderedDict
import asyncio
import calendar
@@ -104,7 +105,11 @@ class Parser(AbstractParser):
groups = data[i]
if i - 1 >= 0:
- course.name = ", ".join(set(data[i - 1].split(';')))
+ # TODO: le jour où la version minimale supportée sera
+ # Python 3.7, il sera possible de remplacer OrderedDict
+ # par un dictionnaire classique.
+ names = OrderedDict.fromkeys(data[i - 1].split(';'))
+ course.name = ", ".join(names.keys())
else:
course.name = "Sans nom"
if i - 2 >= 0: