--- a/candolint/handlers.py Wed Jul 06 14:04:30 2016 +0800
+++ b/candolint/handlers.py Wed Jul 06 16:43:51 2016 +0800
class CheckHandler(BaseHandler):
def get(self, domain, user, name, check_num, format_='html'):
project = get_project_or_404(domain, user, name)
- if check_num == 'latest':
- check = get_or_404(Check, project=project)
- check = get_or_404(Check, project=project, ordinal=check_num)
+ .where(Check.project == project))
+ if check_num != 'latest':
+ check_query = check_query.where(Check.ordinal == check_num)
+ check = get_or_404(check_query)
lines = json_decode(check.lines)
self.get_raw(project, check, lines)