From fd8a6c94c219b2f83ac3fbc39529683e5fa67ae1 Mon Sep 17 00:00:00 2001 From: albertas-jn <24507839+albertas-jn@users.noreply.github.com> Date: Fri, 12 Apr 2024 08:10:12 +0200 Subject: [PATCH] Fix linter errors 2 --- backend/experiment/questions/demographics.py | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/backend/experiment/questions/demographics.py b/backend/experiment/questions/demographics.py index aa6284cb0..2da492dba 100644 --- a/backend/experiment/questions/demographics.py +++ b/backend/experiment/questions/demographics.py @@ -147,23 +147,29 @@ ] -# Temporary until full Question model is implemented -from .utils import question_by_key -question_dgf_education_matching_pairs = question_by_key('dgf_education', drop_choices=['isced-2', 'isced-5']) -question_dgf_education_matching_pairs.key = 'dgf_education_matching_pairs' +def demographics_other(): + from .utils import question_by_key + + questions = [] + + question = question_by_key('dgf_education', drop_choices=['isced-2', 'isced-5']) + question.key = 'dgf_education_matching_pairs' + questions.append(question) -question_dgf_education_gold_msi = question_by_key('dgf_education', drop_choices=['isced-1']) -question_dgf_education_gold_msi.key = 'dgf_education_gold_msi' + question = question_by_key('dgf_education', drop_choices=['isced-1']) + question.key = 'dgf_education_gold_msi' + questions.append(question) -question_dgf_education_huang_2022 = question_by_key('dgf_education', drop_choices=['isced-5']) -question_dgf_education_huang_2022.key = 'dgf_education_huang_2022' + question = question_by_key('dgf_education', drop_choices=['isced-5']) + question.key = 'dgf_education_huang_2022' + questions.append(question) -DEMOGRAPHICS_OTHER = [ - question_dgf_education_matching_pairs, - question_dgf_education_gold_msi, - question_dgf_education_huang_2022, + return questions + +# Temporary until full Question model is implemented +DEMOGRAPHICS_OTHER = demographics_other() + [ TextQuestion( key='fame_name', question=_("Enter a name to enter the ICMPC hall of fame"),