Some uninitialized build triggers may not yet have a write token.
This commit is contained in:
parent
74d1c4e6b0
commit
70a35ab421
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue