фикс 2
This commit is contained in:
12
app.py
12
app.py
@@ -1779,22 +1779,22 @@ def admin_db_create_account(
|
||||
if row:
|
||||
return render_admin_db_index(
|
||||
request,
|
||||
account_output=f"Пользователь создан: {username} (id={row[0]})\nРоль: {role}",
|
||||
account_success=True,
|
||||
parser_output=f"Пользователь создан: {username} (id={row[0]})\nРоль: {role}",
|
||||
parser_success=True,
|
||||
)
|
||||
|
||||
return render_admin_db_index(
|
||||
request,
|
||||
account_output=f"Пользователь '{username}' уже существует.",
|
||||
account_success=False,
|
||||
parser_output=f"Пользователь '{username}' уже существует.",
|
||||
parser_success=False,
|
||||
)
|
||||
|
||||
except Exception:
|
||||
conn.rollback()
|
||||
return render_admin_db_index(
|
||||
request,
|
||||
account_output="Ошибка при создании аккаунта:\n" + traceback.format_exc(),
|
||||
account_success=False,
|
||||
parser_output="Ошибка при создании аккаунта:\n" + traceback.format_exc(),
|
||||
parser_success=False,
|
||||
)
|
||||
finally:
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user