mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
fix: convert user creation and update dates to timezone-aware datetime
This commit is contained in:
parent
a661d16c38
commit
2fdbff85a9
2 changed files with 4 additions and 4 deletions
|
|
@ -54,8 +54,8 @@ class UIDatabase(Database):
|
|||
"method": ui_user.method,
|
||||
"theme": ui_user.theme,
|
||||
"totp_secret": ui_user.totp_secret,
|
||||
"creation_date": ui_user.creation_date,
|
||||
"update_date": ui_user.update_date,
|
||||
"creation_date": ui_user.creation_date.astimezone(),
|
||||
"update_date": ui_user.update_date.astimezone(),
|
||||
"roles": [role.role_name for role in ui_user.roles],
|
||||
"recovery_codes": [recovery_code.code for recovery_code in ui_user.recovery_codes],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,8 +248,8 @@ def setup_loading():
|
|||
|
||||
db_config = DB.get_config(filtered_settings=("SERVER_NAME", "USE_UI", "REVERSE_PROXY_URL"))
|
||||
ui_service = {}
|
||||
ui_admin = DB.get_ui_user()
|
||||
admin_old_enough = ui_admin and ui_admin.creation_date < datetime.now().astimezone() - timedelta(minutes=5)
|
||||
ui_admin = DB.get_ui_user(as_dict=True)
|
||||
admin_old_enough = ui_admin and ui_admin["creation_date"] < datetime.now().astimezone() - timedelta(minutes=5)
|
||||
|
||||
for server_name in db_config["SERVER_NAME"].split(" "):
|
||||
if server_name and db_config.get(f"{server_name}_USE_UI", "no") == "yes":
|
||||
|
|
|
|||
Loading…
Reference in a new issue