Skip to content

Commit

Permalink
Reduced the complexity and line length.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Baidan committed Dec 14, 2021
1 parent 6472199 commit d2029ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 1 addition & 4 deletions survey/management/commands/import_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ def handle(self, *args, **options):

@staticmethod
def does_question_exists(label: str, questions):
for question in questions:
if question.label == label:
return True
return False
return label in [question.label for question in questions]

@staticmethod
def process_answers_dependencies(answers_dependencies: Dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='surveyquestion',
name='qtype',
field=models.CharField(choices=[('M', 'Multiple Choice'), ('S', 'Single Choice'), ('SS', 'Single Select Choice'), ('T', 'Free text'), ('MT', 'Multiple Choice + Free Text'), ('ST', 'Single Choice + Free Text')], default='M', max_length=2),
field=models.CharField(choices=[
('M', 'Multiple Choice'),
('S', 'Single Choice'),
('SS', 'Single Select Choice'),
('T', 'Free text'),
('MT', 'Multiple Choice + Free Text'),
('ST', 'Single Choice + Free Text')
], default='M', max_length=2),
),
migrations.AlterField(
model_name='surveyquestionanswer',
Expand Down

0 comments on commit d2029ef

Please sign in to comment.