alex / django-templatetag-sugar

This project exists to make defining template tags in Django kickass
BSD 3-Clause "New" or "Revised" License
211 stars 38 forks source link

Ambiguous errors on improper tag syntax in template #2

Closed unbracketed closed 14 years ago

unbracketed commented 14 years ago

Syntax checking could be improved during parsing since it is possible to get some ambiguous errors if a tag's syntax is not specified properly in a template. For example, taking the fairly canonical context-populating tag:

@tag(register,
 [Constant("for"), Variable(), Optional([Constant("as"), Name()])])
    def get_comments_for_article(context, article_id, varname=None):
        #...

If you attempt to reference the tag in a template via:

{% get_comments_for_article %}

the error is severe enough that you don't even get the Django 500 page.

alex commented 14 years ago

Fixed in b9ae4753056f38bcab4b