Skip to content

Commit b16e4e1

Browse files
authored
Minor typos in auth.py (#973)
1 parent 075eac5 commit b16e4e1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

py4web/utils/auth.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,8 @@ def login(self, email, password):
673673
if not hasattr(plugin, "get_login_url"):
674674
prevent_db_lookup = True
675675
if plugin.check_credentials(email, password):
676-
# if the creadentials are independently validated
677-
# get of create the user (if does not exist)
676+
# if the credentials are independently validated
677+
# get or create the user (if does not exist)
678678
user_info = {}
679679
user_info["sso_id"] = plugin.name + ":" + email
680680
if self.use_username or "@" not in email:
@@ -906,7 +906,7 @@ def get_or_register_user(self, user):
906906
row.update_record(**user)
907907
# pass the full user
908908
user = row.as_dict()
909-
# othrewise we id the user via email
909+
# otherwise we id the user via email
910910
elif user.get("email"):
911911
keyid = "email"
912912
# return a user if exists and has a verified email
@@ -924,7 +924,7 @@ def get_or_register_user(self, user):
924924
user["username"] = user[keyid]
925925
# make sure the username is unique
926926
if db(db.auth_user.username == user["username"]).count():
927-
raise HTTP(401, body=f"Conficting {user['username']} accounts")
927+
raise HTTP(401, body=f"Conflicting {user['username']} accounts")
928928
# create the user
929929
user["id"] = db.auth_user.insert(**db.auth_user._filter_fields(user))
930930
return user
@@ -945,8 +945,8 @@ def _success(self, message, code=200):
945945
# Other service methods (that can be overwritten)
946946

947947
def send(self, name, user, **attrs):
948-
"""Extends the object and override the function to send messages with
949-
twilio or onesignal or alternative method other than email
948+
"""Extends the object and overrides the function to send messages with
949+
twilio or onesignal or an alternative method other than email
950950
"""
951951

952952
message = self.param.messages[name]
@@ -1522,7 +1522,7 @@ def register(self, model=False):
15221522
form = Form(fields, submit_value=button_name, formstyle=self.formstyle)
15231523
user = None
15241524
if form.accepted:
1525-
# notice that here the form is alrealdy validated
1525+
# notice that here the form is already validated
15261526
if not self.auth.password_in_db: # password must not be written in db
15271527
# Prioritize PAM or LDAP logins if enabled
15281528
if "pam" in self.auth.plugins or "ldap" in self.auth.plugins:
@@ -1569,7 +1569,7 @@ def login_buttons(self):
15691569
top_buttons = []
15701570

15711571
for name, plugin in self.auth.plugins.items():
1572-
# do not add a button for plugin that do not delegate to url
1572+
# do not add a button for a plugin that does not delegate to url
15731573
if not hasattr(plugin, "get_login_url"):
15741574
continue
15751575

0 commit comments

Comments
 (0)