ruff again :)

This commit is contained in:
Christian Hagenest
2024-06-26 16:05:51 +02:00
parent 07802569ef
commit 64de63815d
2 changed files with 7 additions and 5 deletions

View File

@@ -106,7 +106,8 @@ def lookup_passdb(db, config: Config, user, cleartext_password):
if userdata: if userdata:
# Update last login time. # Update last login time.
conn.execute( conn.execute(
"UPDATE users SET last_login=? WHERE addr=?", (round(int(time.time()) // 86400), user) "UPDATE users SET last_login=? WHERE addr=?",
(round(int(time.time()) // 86400), user),
) )
userdata["home"] = f"/home/vmail/mail/{config.mail_domain}/{user}" userdata["home"] = f"/home/vmail/mail/{config.mail_domain}/{user}"

View File

@@ -25,6 +25,7 @@ def remove_users(db: Database, cutoff_date: int):
finally: finally:
db.close() db.close()
def remove_user_data(db: Database, cutoff_date: int, dir: Path): def remove_user_data(db: Database, cutoff_date: int, dir: Path):
"""Collects all users where last_login < cutoff_date and deletes corresponding directories.""" """Collects all users where last_login < cutoff_date and deletes corresponding directories."""
db.connect() db.connect()