Reformat SQL statement for clarity and wrap the long line.

This commit is contained in:
Ben Finney 2022-12-19 09:25:58 +11:00
parent 237abe539a
commit 34ab6489ba

View file

@ -21,7 +21,15 @@ db_name = "mastodon"
# This is the query that pulls the password hash for the given user. Mastodon doesn't store the domain for local accounts in
# the database, so we ignore the host component and try to match username where the domain is NULL.
db_query_getpass = "select users.encrypted_password as password from accounts inner join users on accounts.id=users.account_id where lower(accounts.username) = %(user)s and accounts.domain is null"
db_query_getpass = """
SELECT users.encrypted_password AS password
FROM accounts
INNER JOIN users
ON accounts.id = users.account_id
WHERE
lower(accounts.username) = %(user)s
AND accounts.domain IS NULL
"""
########################################################################
# Setup