Corect code style for main Python module. #2

Merged
mike merged 17 commits from bignose/ejabberd-auth-mastodon:wip/maintenance/code-style into master 2023-01-01 21:50:41 +11:00
Showing only changes of commit 7118641d78 - Show all commits

View file

@ -138,16 +138,16 @@ def get_password(user, host):
cursor.execute(db_query_getpass, {"user": user.lower(), "host": host}) cursor.execute(db_query_getpass, {"user": user.lower(), "host": host})
data = cursor.fetchone() data = cursor.fetchone()
cursor.close() cursor.close()
return data[0] if data != None else None return data[0] if data is not None else None
def isuser(user, host): def isuser(user, host):
return get_password(user, host) != None return get_password(user, host) is not None
def auth(user, host, password): def auth(user, host, password):
db_password = get_password(user, host) db_password = get_password(user, host)
if db_password == None: if db_password is None:
logging.debug("Wrong username: %s@%s" % (user, host)) logging.debug("Wrong username: %s@%s" % (user, host))
return False return False
else: else: