Skip to content

Commit

Permalink
refactor: if-statement easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
johachi committed Jun 1, 2021
1 parent 1ddc730 commit 923850f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/lib/utils/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ def validate_login(react_context):
error_code = common.get_path(path_error_code, react_context)
LOG.error('Login not valid, error code {}', error_code)
error_description = common.get_local_string(30102) + error_code
if error_code in error_code_list:
error_description = error_code_list[error_code]
if 'email_' + error_code in error_code_list:
error_description = error_code_list['email_' + error_code]
if 'login_' + error_code in error_code_list:
error_description = error_code_list['login_' + error_code]
elif 'email_' + error_code in error_code_list:
error_description = error_code_list['email_' + error_code]
elif error_code in error_code_list:
error_description = error_code_list[error_code]
raise LoginValidateError(common.remove_html_tags(error_description))
except (AttributeError, KeyError) as exc:
import traceback
Expand Down

0 comments on commit 923850f

Please sign in to comment.