1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

Corrected many style guide violations that the newest version of flake8 catches

This commit is contained in:
Alex Gaynor
2014-03-30 12:11:05 -07:00
parent 92dbf34286
commit 778ce245dd
39 changed files with 55 additions and 54 deletions

View File

@@ -926,7 +926,7 @@ def pluralize(value, arg='s'):
* If value is 1, cand{{ value|pluralize:"y,ies" }} displays "1 candy".
* If value is 2, cand{{ value|pluralize:"y,ies" }} displays "2 candies".
"""
if not ',' in arg:
if ',' not in arg:
arg = ',' + arg
bits = arg.split(',')
if len(bits) > 2:

View File

@@ -605,7 +605,7 @@ def cycle(parser, token):
name = args[1]
if not hasattr(parser, '_namedCycleNodes'):
raise TemplateSyntaxError("No named cycles in template. '%s' is not defined" % name)
if not name in parser._namedCycleNodes:
if name not in parser._namedCycleNodes:
raise TemplateSyntaxError("Named cycle '%s' does not exist" % name)
return parser._namedCycleNodes[name]