fix: /admin/user/<id> SQLite 연결 에러 해결
- new_connection=True + finally close 적용
This commit is contained in:
parent
866d10fd92
commit
4691d65c14
@ -1233,9 +1233,10 @@ def admin_transaction_detail(transaction_id):
|
||||
@app.route('/admin/user/<int:user_id>')
|
||||
def admin_user_detail(user_id):
|
||||
"""사용자 상세 이력 조회 - 구매 이력, 적립 이력, 구매 품목"""
|
||||
conn = None
|
||||
try:
|
||||
# 1. SQLite 연결
|
||||
conn = db_manager.get_sqlite_connection()
|
||||
# 1. SQLite 연결 (새 연결 사용)
|
||||
conn = db_manager.get_sqlite_connection(new_connection=True)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# 2. 사용자 기본 정보 조회
|
||||
@ -1401,10 +1402,18 @@ def admin_user_detail(user_id):
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
import traceback
|
||||
logging.error(f"사용자 상세 조회 실패: {e}\n{traceback.format_exc()}")
|
||||
return jsonify({
|
||||
'success': False,
|
||||
'message': f'조회 실패: {str(e)}'
|
||||
}), 500
|
||||
finally:
|
||||
if conn:
|
||||
try:
|
||||
conn.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/admin/search/user')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user