def post(self): producer = BaseProducer.load_producer_by_id(self.get_argument("sched_id")) if not producer: raise APIException("internal_error", "Producer ID %s not found." % self.get_argument("sched_id")) db.c.update("UPDATE r4_schedule SET sched_url = %s WHERE sched_id = %s", (self.get_argument("url"), self.get_argument("sched_id"))) if self.get_argument("url"): self.append_standard("success", "Producer URL changed to '%s'." % self.get_argument("url")) else: self.append_standard("success", "Producer URL removed.")
def post(self): producer = BaseProducer.load_producer_by_id( self.get_argument("sched_id")) if not producer: raise APIException( "internal_error", "Producer ID %s not found." % self.get_argument("sched_id")) new_producer = producer.duplicate() self.append(self.return_name, new_producer.to_dict())
def post(self): producer = BaseProducer.load_producer_by_id( self.get_argument("sched_id")) if not producer: raise APIException( "internal_error", "Producer ID %s not found." % self.get_argument("sched_id")) db.c.update("DELETE FROM r4_schedule WHERE sched_id = %s", (self.get_argument("sched_id"), )) self.append_standard("success", "Producer deleted.")
def post(self): producer = BaseProducer.load_producer_by_id( self.get_argument("sched_id")) if not producer: raise APIException( "internal_error", "Producer ID %s not found." % self.get_argument("sched_id"), ) new_producer = producer.duplicate() new_producer.name += " Reprisal" start_eu = datetime.fromtimestamp( producer.start, timezone("UTC")).replace(tzinfo=timezone("Europe/London")).replace( hour=10, minute=0, second=0, microsecond=0) + timedelta(days=1) start_epoch_eu = int( (start_eu - datetime.fromtimestamp(0, timezone("UTC"))).total_seconds()) new_producer.change_start(start_epoch_eu) db.c.update( "UPDATE r4_schedule SET sched_name = %s WHERE sched_id = %s", (new_producer.name, new_producer.id), ) self.append(self.return_name, new_producer.to_dict())
def post(self): producer = BaseProducer.load_producer_by_id( self.get_argument("sched_id")) producer.change_end(self.get_argument("utc_time")) self.append(self.return_name, producer.to_dict())
def post(self): producer = BaseProducer.load_producer_by_id(self.get_argument("sched_id")) producer.change_end(self.get_argument("utc_time")) self.append(self.return_name, producer.to_dict())
def post(self): producer = BaseProducer.load_producer_by_id(self.get_argument("sched_id")) if not producer: raise APIException("internal_error", "Producer ID %s not found." % self.get_argument("sched_id")) db.c.update("DELETE FROM r4_schedule WHERE sched_id = %s", (self.get_argument("sched_id"),)) self.append_standard("success", "Producer deleted.")