Download:
child 231:fac95513f366
parent 229:2d2ee1d1d823
230:fad96431bcb1
Anton Shestakov <av6@dwimlabs.net>, Thu, 25 Aug 2016 18:59:48 +0800
viewer: show "unknown" in status badge when no checks have been done yet

1 файлов изменено, 5 вставок(+), 2 удалений(-) [+]
candolint/handlers.py file | annotate | diff | comparison | revisions
--- a/candolint/handlers.py Thu Aug 25 11:41:31 2016 +0800
+++ b/candolint/handlers.py Thu Aug 25 18:59:48 2016 +0800
@@ -128,9 +128,12 @@
class StatusHandler(BaseHandler):
def get(self, domain, user, name):
project = get_project_or_404(domain, user, name)
- check = get_or_404(Check, project=project)
+ check = (Check
+ .select(*Check.get_light_fields())
+ .where(Check.project == project)
+ .first())
parts = [('#555', 30, 14.5, 'lint')]
- if not check.success:
+ if check is None or not check.success:
parts.append(('#777', 62, 30.5, 'unknown'))
elif check.errors or check.warnings:
if check.errors: