def post(self): e = event.OneUp.create(self.sid, 0, self.get_argument("song_id")) self.append(self.return_name, { "success": True, "sched_id": e.id, "text": "OneUp Added" }) sync_to_back.refresh_schedule(self.sid)
def post(self): e = event.OneUp.load_by_id(self.get_argument("sched_id")) if e.used: raise Exception("OneUp already used.") r = db.c.update("DELETE FROM r4_schedule WHERE sched_id = %s", (e.id,)) if r: self.append(self.return_name, { "success": True, "text": "OneUp deleted." }) sync_to_back.refresh_schedule(self.sid) else: self.append(self.return_name, { "success": False, "text": "OneUp not deleted." })
def post(self): e = event.OneUp.load_by_id(self.get_argument("sched_id")) if e.used: raise Exception("OneUp already used.") r = db.c.update("DELETE FROM r4_schedule WHERE sched_id = %s", (e.id, )) if r: self.append(self.return_name, { "success": True, "text": "OneUp deleted." }) sync_to_back.refresh_schedule(self.sid) else: self.append(self.return_name, { "success": False, "text": "OneUp not deleted." })