Django

Code

Ticket #6535 (new)

Opened 2 years ago

Last modified 2 years ago

parser.compile_filter() does not support negative numbers

Reported by: Collin Grady <cgrady@the-magi.us> Assigned to: nobody
Milestone: Component: Template system
Version: SVN Keywords: tplrf-fixed
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 1 Patch needs improvement: 0

Description

After writing a patch for #5756, a new issue presented itself - another user tried {% ifequal -1 -1 %} and it threw a TemplateSyntaxError stating that it could not parse the remainder "-1"

A small tweak to a regex in django/template/__init__.py appears to correct the issue, but I'm not sure if a better change is needed along these lines to make it so the - can only be at the start of a number.

Attachments

6535.patch (478 bytes) - added by Collin Grady <cgrady@the-magi.us> on 02/01/08 20:41:34.

Change History

02/01/08 20:41:34 changed by Collin Grady <cgrady@the-magi.us>

  • attachment 6535.patch added.

06/09/08 18:16:56 changed by jacob

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests set to 1.
  • needs_docs changed.

07/18/08 14:03:23 changed by emulbreh

  • keywords set to tplrf-fixed.

This would be fixed by the refactoring proposed in #7806.


Add/Change #6535 (parser.compile_filter() does not support negative numbers)




Change Properties
Action