fix(cupang): 시트 기록 결과를 로그·화면에 항상 표시

미설정/건너뜀도 사유를 보여준다(이전엔 조용히 넘어가 원인 파악이 어려웠음).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-01 15:05:36 +09:00
parent 63cfdc87ec
commit 042d5f8574
2 changed files with 8 additions and 2 deletions
+5
View File
@@ -1435,6 +1435,11 @@ async def box_calc_confirm(
# 구글 스프레드시트에 출고일 시트 기록(설정돼 있을 때만).
sheet = _push_to_google_sheet(store, ship_date)
print( # noqa: T201 - 컨테이너 로그로 확인용(비밀값 없음)
f"[cupang] sheet push date={ship_date} ok={sheet.get('ok')} "
f"skipped={sheet.get('skipped')} reason={sheet.get('reason', '')}",
flush=True,
)
return JSONResponse({"created": created, "ship_date": ship_date, "sheet": sheet})
@@ -1333,8 +1333,9 @@
window.location.href = "/cupang/export.xlsx?date=" + encodeURIComponent(d);
// 구글 시트 기록 결과 (설정돼 있을 때만 동작)
var sh = (data && data.sheet) || {};
var sheetNote = sh.ok ? "구글 시트 " + (sh.title || "") + " 기록 완료"
: (sh.skipped ? "" : "구글 시트 기록 실패 — " + (sh.reason || ""));
var sheetNote = sh.ok
? "구글 시트 " + (sh.title || "") + " 기록 완료"
: "구글 시트 기록 안 됨 — " + (sh.reason || "사유 불명");
// 업로드한 출고일이 여러 개면 남은 날짜 작업을 이어서 한다.
var idx = dateOrder.indexOf(activeDate);
if (idx >= 0 && dateOrder.length > 1) {