def delete_view(self, request):
client = self.parent.parent.client
if request.method == 'POST':
client.job_configs.remove(self.config)
# Could just leave it there, but likely not the intention behind clicking (delete).
for schedule in data_root().schedules:
for action in list(schedule.actions):
if getattr(action, 'job_config', None) == self.config:
schedule.actions.remove(action)
transaction.get().note('Deleted job config %s from client %s' % (self.config.oid, client.hostname))
transaction.commit()
return self.redirect_to()
评论列表
文章目录