diff --git a/homu/server.py b/homu/server.py index c56a6c5..b5c4d5b 100644 --- a/homu/server.py +++ b/homu/server.py @@ -117,7 +117,10 @@ def result(repo_label, pull): @get('/queue/') def queue(repo_label): - if repo_label not in g.cfg['repo'] and repo_label != 'all': + + labels = repo_label.split('+') + if repo_label != 'all' \ + and any(label not in g.cfg['repo'] for label in labels): abort(404) logger = g.logger.getChild('queue') @@ -126,19 +129,20 @@ def queue(repo_label): single_repo_closed = None treeclosed_src = None + repo_url = None + if repo_label == 'all': labels = g.repos.keys() multiple = True - repo_url = None else: - labels = repo_label.split('+') multiple = len(labels) > 1 - if repo_label in g.repos and g.repos[repo_label].treeclosed >= 0: - single_repo_closed = g.repos[repo_label].treeclosed - treeclosed_src = g.repos[repo_label].treeclosed_src - repo_url = 'https://github.com/{}/{}'.format( - g.cfg['repo'][repo_label]['owner'], - g.cfg['repo'][repo_label]['name']) + if not multiple: + if repo_label in g.repos and g.repos[repo_label].treeclosed >= 0: + single_repo_closed = g.repos[repo_label].treeclosed + treeclosed_src = g.repos[repo_label].treeclosed_src + repo_url = 'https://github.com/{}/{}'.format( + g.cfg['repo'][repo_label]['owner'], + g.cfg['repo'][repo_label]['name']) states = [] for label in labels: