The previous order of removing triggers and their push keys violated a DB constraint.

This commit is contained in:
Jake Moshenko 2014-07-25 13:46:22 -04:00
parent 0fcb7da6a1
commit 268c28649a

View file

@ -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