--- a/candolint/handlers.py Tue Nov 28 11:55:40 2017 +0800
+++ b/candolint/handlers.py Tue Nov 28 11:56:47 2017 +0800
class AtomHandler(BaseHandler):
+ def get_check_status(self, check):
+ elif check.errors or check.warnings:
+ msg = self.locale.translate(
+ '{} error', '{} errors', check.errors)
+ status.append(msg.format(check.errors))
+ msg = self.locale.translate(
+ '{} warning', '{} warnings', check.warnings)
+ status.append(msg.format(check.warnings))
+ return ', '.join(status)
def get(self, domain, user, name):
project = get_project_or_404(domain, user, name)
.where(Check.project == project)
.order_by(Check.ordinal.desc()))
- elif check.errors or check.warnings:
- msg = self.locale.translate(
- '{} error', '{} errors', check.errors)
- status.append(msg.format(check.errors))
- msg = self.locale.translate(
- '{} warning', '{} warnings', check.warnings)
- status.append(msg.format(check.warnings))
- return ', '.join(status)
self.set_header('Content-Type', 'application/atom+xml; charset=utf-8')
- self.render('atom.xml', project=project, checks=checks, status=status)
+ self.render('atom.xml', project=project, checks=checks, status=self.get_check_status)
class CheckHandler(BaseHandler):