More code cleanup and fix bug around can_admin in the trigger_view

This commit is contained in:
Joseph Schorr 2015-05-03 11:02:05 -07:00
parent c89760278f
commit 0b990677a0
3 changed files with 25 additions and 39 deletions

View file

@ -52,6 +52,9 @@ def trigger_view(trigger, can_read=False, can_admin=False):
repo_url = build_trigger.get_repository_url() if build_source else None
if can_admin:
can_read = True
return {
'service': trigger.service.name,
'build_source': build_source if can_read else None,