From b9a97040610a9b27ba468748811358a2788344f2 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Mon, 2 Aug 2021 18:22:19 +0200
Subject: [PATCH] [WEI] Prepare WEI 2021 No need to save WEI 2020 data because
 there weren't any WEI 2020

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 apps/wei/forms/surveys/__init__.py            |  4 +--
 .../forms/surveys/{wei2020.py => wei2021.py}  | 28 +++++++++----------
 2 files changed, 16 insertions(+), 16 deletions(-)
 rename apps/wei/forms/surveys/{wei2020.py => wei2021.py} (86%)

diff --git a/apps/wei/forms/surveys/__init__.py b/apps/wei/forms/surveys/__init__.py
index 56ffd47a..f5172c4a 100644
--- a/apps/wei/forms/surveys/__init__.py
+++ b/apps/wei/forms/surveys/__init__.py
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 
 from .base import WEISurvey, WEISurveyInformation, WEISurveyAlgorithm
-from .wei2020 import WEISurvey2020
+from .wei2021 import WEISurvey2021
 
 
 __all__ = [
     'WEISurvey', 'WEISurveyInformation', 'WEISurveyAlgorithm', 'CurrentSurvey',
 ]
 
-CurrentSurvey = WEISurvey2020
+CurrentSurvey = WEISurvey2021
diff --git a/apps/wei/forms/surveys/wei2020.py b/apps/wei/forms/surveys/wei2021.py
similarity index 86%
rename from apps/wei/forms/surveys/wei2020.py
rename to apps/wei/forms/surveys/wei2021.py
index 0baa31ff..6ecf3107 100644
--- a/apps/wei/forms/surveys/wei2020.py
+++ b/apps/wei/forms/surveys/wei2021.py
@@ -20,9 +20,9 @@ WORDS = ['Rap', 'Retro', 'DJ', 'Rock', 'Jazz', 'Chansons Populaires', 'Chansons
          'Se lacher', 'Chill', 'Débile', 'Beauf', 'Bon enfant']
 
 
-class WEISurveyForm2020(forms.Form):
+class WEISurveyForm2021(forms.Form):
     """
-    Survey form for the year 2020.
+    Survey form for the year 2021.
     Members choose 20 words, from which we calculate the best associated bus.
     """
 
@@ -44,7 +44,7 @@ class WEISurveyForm2020(forms.Form):
         self.fields["word"].choices = words
 
 
-class WEIBusInformation2020(WEIBusInformation):
+class WEIBusInformation2021(WEIBusInformation):
     """
     For each word, the bus has a score
     """
@@ -54,7 +54,7 @@ class WEIBusInformation2020(WEIBusInformation):
         super().__init__(bus)
 
 
-class WEISurveyInformation2020(WEISurveyInformation):
+class WEISurveyInformation2021(WEISurveyInformation):
     """
     We store the id of the selected bus. We store only the name, but is not used in the selection:
     that's only for humans that try to read data.
@@ -67,21 +67,21 @@ class WEISurveyInformation2020(WEISurveyInformation):
         super().__init__(registration)
 
 
-class WEISurvey2020(WEISurvey):
+class WEISurvey2021(WEISurvey):
     """
-    Survey for the year 2020.
+    Survey for the year 2021.
     """
 
     @classmethod
     def get_year(cls):
-        return 2020
+        return 2021
 
     @classmethod
     def get_survey_information_class(cls):
-        return WEISurveyInformation2020
+        return WEISurveyInformation2021
 
     def get_form_class(self):
-        return WEISurveyForm2020
+        return WEISurveyForm2021
 
     def update_form(self, form):
         """
@@ -98,7 +98,7 @@ class WEISurvey2020(WEISurvey):
 
     @classmethod
     def get_algorithm_class(cls):
-        return WEISurveyAlgorithm2020
+        return WEISurveyAlgorithm2021
 
     def is_complete(self) -> bool:
         """
@@ -107,20 +107,20 @@ class WEISurvey2020(WEISurvey):
         return self.information.step == 20
 
 
-class WEISurveyAlgorithm2020(WEISurveyAlgorithm):
+class WEISurveyAlgorithm2021(WEISurveyAlgorithm):
     """
-    The algorithm class for the year 2020.
+    The algorithm class for the year 2021.
     For now, the algorithm is quite simple: the selected bus is the chosen bus.
     TODO: Improve this algorithm.
     """
 
     @classmethod
     def get_survey_class(cls):
-        return WEISurvey2020
+        return WEISurvey2021
 
     @classmethod
     def get_bus_information_class(cls):
-        return WEIBusInformation2020
+        return WEIBusInformation2021
 
     def run_algorithm(self):
         for registration in self.get_registrations():
-- 
GitLab