fix: product_category_mapping 테이블 없을 때 에러 무시

- 카테고리 조회 시 테이블 없으면 건너뛰도록 try-except 추가
This commit is contained in:
thug0bin 2026-02-27 16:16:00 +09:00
parent 4691d65c14
commit 94a8df6653

View File

@ -1324,9 +1324,10 @@ def admin_user_detail(user_id):
for item in items_raw:
barcode = item.BARCODE
# SQLite에서 제품 카테고리 조회
# SQLite에서 제품 카테고리 조회 (테이블 없으면 건너뜀)
categories = []
if barcode:
try:
cursor.execute("""
SELECT category_name, relevance_score
FROM product_category_mapping
@ -1339,6 +1340,8 @@ def admin_user_detail(user_id):
'name': cat_row[0],
'score': cat_row[1]
})
except Exception:
pass # 테이블 없으면 무시
items.append({
'code': item.DrugCode,