From aa75ce5c7a58c0a733b0764060160642db0163c0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 16 Sep 2021 15:37:18 +0200 Subject: [PATCH] [WEI] Don't manage hardcoded people in repartition algorithm Signed-off-by: Yohann D'ANELLO --- apps/wei/forms/surveys/wei2021.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wei/forms/surveys/wei2021.py b/apps/wei/forms/surveys/wei2021.py index a6a241cb..24538045 100644 --- a/apps/wei/forms/surveys/wei2021.py +++ b/apps/wei/forms/surveys/wei2021.py @@ -170,7 +170,9 @@ class WEISurveyAlgorithm2021(WEISurveyAlgorithm): We modify it to allow buses to have multiple "weddings". """ surveys = list(self.get_survey_class()(r) for r in self.get_registrations()) # All surveys - surveys = [s for s in surveys if s.is_complete()] + surveys = [s for s in surveys if s.is_complete()] # Don't consider invalid surveys + # Don't manage hardcoded people + surveys = [s for s in surveys if not hasattr(s.information, 'hardcoded') or not s.information.hardcoded] free_surveys = [s for s in surveys if not s.information.valid] # Remaining surveys while free_surveys: # Some students are not affected survey = free_surveys[0]