Ticket #12069: url_parser_syntax.diff

File url_parser_syntax.diff, 719 bytes (added by Jeff Schenck, 15 years ago)

Patch for url template tag parsing

Line 
1Index: django/template/defaulttags.py
2===================================================================
3--- django/template/defaulttags.py (revision 12395)
4+++ django/template/defaulttags.py (working copy)
5@@ -%ld,%ld +%ld,%ld @@
6 for bit in bits:
7 if bit == 'as':
8 asvar = bits.next()
9- break
10+ try:
11+ bits.next()
12+ except StopIteration:
13+ pass
14+ else:
15+ raise TemplateSyntaxError("Cannot have any arguments"
16+ " after the 'as var' option")
17 else:
18 for arg in bit.split(","):
19 if '=' in arg:
Back to Top