Reformatted and cleaned up everything

This commit is contained in:
2025-04-16 18:05:07 +02:00
parent e90694f0aa
commit a100324265
9 changed files with 40 additions and 32 deletions

View File

@@ -31,16 +31,12 @@ class PyroUser:
### Returns:
* `PyroUser`: User with its database data.
"""
db_entry = cursor.execute(
"SELECT id, locale FROM users WHERE id = ?", (id,)
).fetchone()
db_entry = cursor.execute("SELECT id, locale FROM users WHERE id = ?", (id,)).fetchone()
if db_entry is None:
cursor.execute("INSERT INTO users VALUES (?, ?)", (id, locale))
cursor.connection.commit()
db_entry = cursor.execute(
"SELECT id, locale FROM users WHERE id = ?", (id,)
).fetchone()
db_entry = cursor.execute("SELECT id, locale FROM users WHERE id = ?", (id,)).fetchone()
if db_entry is None:
raise RuntimeError("Could not find inserted user entry.")