Some uninitialized build triggers may not yet have a write token.

This commit is contained in:
Jake Moshenko 2014-07-18 15:05:39 -04:00
parent 74d1c4e6b0
commit 70a35ab421

View file

@ -81,7 +81,9 @@ class BuildTrigger(RepositoryParamResource):
'service': trigger.service.name, 'config': config_dict},
repo=model.get_repository(namespace, repository))
trigger.write_token.delete_instance()
if trigger.write_token is not None:
trigger.write_token.delete_instance()
trigger.delete_instance(recursive=True)
return 'No Content', 204