--- a/candolint/handlers.py Sat Aug 20 10:10:40 2016 +0800
+++ b/candolint/handlers.py Sat Aug 20 10:21:05 2016 +0800
+def get_check_or_404(project, check_num):
+ .where(Check.project == project))
+ if check_num != 'latest':
+ cq = cq.where(Check.ordinal == check_num)
class BaseHandler(RequestHandler):
class CheckHandler(BaseHandler):
def get(self, domain, user, name, check_num, format_='html'):
project = get_project_or_404(domain, user, name)
- .where(Check.project == project))
- if check_num != 'latest':
- check_query = check_query.where(Check.ordinal == check_num)
- check = get_or_404(check_query)
+ check = get_check_or_404(project, check_num)
lines = json_decode(check.lines)
self.get_raw(project, check, lines)