-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't working
Description
在 admin_role,__read_db 應該要有當資料庫沒有搜尋到(ret得到空清單)按鈕 ID 時的錯誤應對,應該顯示錯誤訊息、提示有異議請開客服單並disable 按鈕
def __read_db(self, btn_id: int):
connection, cursor = link_sql()
cursor.execute(f"SELECT type, count FROM `gift` WHERE `btnID`={btn_id}")
ret = cursor.fetchall()
cursor.execute(f"DELETE FROM `gift` WHERE `btnID`={btn_id}")
end(connection, cursor)
return ret[0][0], ret[0][1] # type, count
如果資料庫資料因為非預期原因遺失了,有例外處理是個比較好的做法
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working