MonicaChen0330 commited on
Commit
560e8aa
·
verified ·
1 Parent(s): 19ab080

fix: announcement

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -65,14 +65,16 @@ def fetch_announcement_from_sheet():
65
  df = pd.read_csv(url)
66
 
67
  if "Announcement" in df.columns:
68
- content = str(df["announcement"].iloc[0]).strip()
69
  if not content:
70
  return "📢 尚無公告"
71
  return f"📢 {content}"
72
  else:
73
- return "📢 無法讀取公告欄位"
 
74
  except Exception as e:
75
- return f"📢 載入公告失敗:{str(e)}"
 
76
 
77
  def validate_openai_key(api_key):
78
  try:
 
65
  df = pd.read_csv(url)
66
 
67
  if "Announcement" in df.columns:
68
+ content = str(df["Announcement"].iloc[0]).strip()
69
  if not content:
70
  return "📢 尚無公告"
71
  return f"📢 {content}"
72
  else:
73
+ print("Error: 無法讀取公告欄位")
74
+ return "📢 尚無公告"
75
  except Exception as e:
76
+ print(f"Error: 載入公告失敗:{str(e)}")
77
+ return "📢 尚無公告"
78
 
79
  def validate_openai_key(api_key):
80
  try: