Move templates check to ok() function.

This commit is contained in:
Steve Howell 2016-07-08 19:44:12 +00:00 committed by Tim Abbott
parent ea089518ee
commit 3e9ceaeaf0
1 changed files with 3 additions and 2 deletions

View File

@ -181,14 +181,15 @@ def check_our_files():
validate(fn)
# Django templates are pretty messy now, so we do minimal checking.
templates = sorted([fn for fn in git_files if fn.endswith('.html') and 'templates' in fn])
templates = [fn for fn in git_files if fn.endswith('.html')]
def ok(fn):
if 'templates' not in fn: return False
if 'api.html' in fn: return False
if 'base.html' in fn: return False
return True
templates = list(filter(ok, templates))
templates = sorted(list(filter(ok, templates)))
assert len(templates) >= 10 # sanity check that we are actually doing work