Skip to content

Commit

Permalink
Format code with black
Browse files Browse the repository at this point in the history
  • Loading branch information
antlarr committed Jun 16, 2021
1 parent fc94ad5 commit a6c4200
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions flask_security/forms.py
Expand Up @@ -593,8 +593,7 @@ def validate(self):
self.setup.errors = list()
self.setup.errors.append(get_message("TWO_FACTOR_METHOD_NOT_AVAILABLE")[0])
return False
if (self.setup.data == "sms" and
self.phone.data and len(self.phone.data) > 0):
if self.setup.data == "sms" and self.phone.data and len(self.phone.data) > 0:
# Somewhat bizarre - but this isn't required the first time around
# when they select "sms". Then they get a field to fill out with
# phone number, then Submit again.
Expand Down
5 changes: 3 additions & 2 deletions flask_security/views.py
Expand Up @@ -751,8 +751,9 @@ def two_factor_setup():
"tf_state": "validating_profile",
"tf_primary_method": pm,
}
new_phone = form.phone.data if (form.phone.data and
len(form.phone.data) > 0) else None
new_phone = (
form.phone.data if (form.phone.data and len(form.phone.data) > 0) else None
)
if new_phone:
user.tf_phone_number = new_phone
_datastore.put(user)
Expand Down

0 comments on commit a6c4200

Please sign in to comment.