fix: remove unnecessary 'from datetime import datetime' in up_login.dspy

datetime module is pre-loaded by ahserver framework, import statements
are not needed and not supported in .dspy files.
This commit is contained in:
yumoqing 2026-04-26 11:32:48 +08:00
parent 8aada101ca
commit 1b5ae8aba9

View File

@ -27,7 +27,6 @@ async with db.sqlorContext(dbname) as sor:
last_fail = getattr(user, 'last_login_fail', None) last_fail = getattr(user, 'last_login_fail', None)
if fail_count >= 3 and last_fail: if fail_count >= 3 and last_fail:
try: try:
from datetime import datetime
stored = datetime.strptime(str(last_fail), '%Y-%m-%d %H:%M:%S') stored = datetime.strptime(str(last_fail), '%Y-%m-%d %H:%M:%S')
elapsed = (datetime.now() - stored).total_seconds() elapsed = (datetime.now() - stored).total_seconds()
if elapsed < 300: if elapsed < 300: