Skip to content

Commit

Permalink
Fix syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Jul 16, 2024
1 parent 88002d2 commit 8c6f85d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion survey_question_type_binary/models/survey_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def validate_binary(self, answers):
if self.constr_mandatory and not answers:
errors.update({self.id: self.constr_error_msg})
if answers:
if not isinstance(answers | (list, tuple)):
if not isinstance(answers, (list, tuple)):
answers = [answers]
for answer in answers:
try:
Expand Down
4 changes: 2 additions & 2 deletions survey_question_type_binary/models/survey_user_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _save_lines(self, question, answer, comment=None, overwrite_existing=True):
)

if question.question_type in ("binary", "multi_binary"):
if not isinstance(answer | (list, tuple)):
if not isinstance(answer , (list, tuple)):
answer = [answer]
if not answer:
answer = [False]

Check warning on line 21 in survey_question_type_binary/models/survey_user_input.py

View check run for this annotation

Codecov / codecov/patch

survey_question_type_binary/models/survey_user_input.py#L21

Added line #L21 was not covered by tests
Expand All @@ -36,7 +36,7 @@ def _get_line_answer_values(self, question, answer, answer_type):
del vals["value_binary"]
else:
del vals["value_multi_binary"]
if not isinstance(answer | (list, tuple)):
if not isinstance(answer , (list, tuple)):
answer = [answer]
answer_binary_datas = []
for answer_binary in answer:
Expand Down

0 comments on commit 8c6f85d

Please sign in to comment.