Download:
child 270:9842fdf0d791
parent 268:da6e116a8c41
269:f7bed0a8edef
Anton Shestakov <av6@dwimlabs.net>, Sat, 22 Jul 2017 12:35:06 +0800
viewer: support branch argument for status.svg

1 файлов изменено, 6 вставок(+), 3 удалений(-) [+]
candolint/handlers.py file | annotate | diff | comparison | revisions
--- a/candolint/handlers.py Sat Jul 01 00:27:05 2017 +0800
+++ b/candolint/handlers.py Sat Jul 22 12:35:06 2017 +0800
@@ -155,10 +155,13 @@
class StatusHandler(BaseHandler):
def get(self, domain, user, name):
project = get_project_or_404(domain, user, name)
- check = (Check
+ checks = (Check
.select(*Check.get_light_fields())
- .where(Check.project == project)
- .first())
+ .where(Check.project == project))
+ branch = self.get_argument('branch', None)
+ if branch is not None:
+ checks = checks.join(Change).where(Change.branch == branch)
+ check = checks.first()
parts = [('#555', 30, 14.5, 'lint')]
if check is None or not check.success:
parts.append(('#777', 62, 30.5, 'unknown'))