From 268c28649adda31bdca308cb04accbb068775915 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Fri, 25 Jul 2014 13:46:22 -0400 Subject: [PATCH] The previous order of removing triggers and their push keys violated a DB constraint. --- endpoints/api/trigger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/endpoints/api/trigger.py b/endpoints/api/trigger.py index 484601ee7..3203e4a79 100644 --- a/endpoints/api/trigger.py +++ b/endpoints/api/trigger.py @@ -81,10 +81,11 @@ class BuildTrigger(RepositoryParamResource): 'service': trigger.service.name, 'config': config_dict}, repo=model.get_repository(namespace, repository)) + trigger.delete_instance(recursive=True) + if trigger.write_token is not None: trigger.write_token.delete_instance() - trigger.delete_instance(recursive=True) return 'No Content', 204