PEP 8 specifies:
* Imports should usually be on separate lines.
* Imports are always put at the top of the file, just after any module
comments and docstrings, and before module globals and constants.
* Imports should be grouped in the following order:
* Standard library imports.
* Related third party imports.
* Local application/library specific imports.
PEP 8 specifies:
* Surround top-level function and class definitions with two blank lines.
* Method definitions inside a class are surrounded by a single blank line.
PEP 8 specifies:
* Use 4 spaces per indentation level.
* Continuation lines should align wrapped elements either vertically using
Python’s implicit line joining inside parentheses, brackets and braces,
or using a hanging indent.
I made some poor assumptions about case-sensitivity in relation to the Mastodon accounts table. Changed now to force username comparison to lower during the select statement, and not trust that we're getting lower case from the ejabberd end, either. This should eliminate the issue of some users being unable to authenticate.