{"action":"created","issue":{"url":"https://api.github.com/repos/django/django/issues/6602","repository_url":"https://api.github.com/repos/django/django","labels_url":"https://api.github.com/repos/django/django/issues/6602/labels{/name}","comments_url":"https://api.github.com/repos/django/django/issues/6602/comments","events_url":"https://api.github.com/repos/django/django/issues/6602/events","html_url":"https://github.com/django/django/pull/6602","id":154877932,"number":6602,"title":"Fixed #26573 -- Added descriptive error message for malformed if/else/elif template tags.","user":{"login":"inondle","id":12456116,"avatar_url":"https://avatars.githubusercontent.com/u/12456116?v=3","gravatar_id":"","url":"https://api.github.com/users/inondle","html_url":"https://github.com/inondle","followers_url":"https://api.github.com/users/inondle/followers","following_url":"https://api.github.com/users/inondle/following{/other_user}","gists_url":"https://api.github.com/users/inondle/gists{/gist_id}","starred_url":"https://api.github.com/users/inondle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inondle/subscriptions","organizations_url":"https://api.github.com/users/inondle/orgs","repos_url":"https://api.github.com/users/inondle/repos","events_url":"https://api.github.com/users/inondle/events{/privacy}","received_events_url":"https://api.github.com/users/inondle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-14T22:03:45Z","updated_at":"2016-05-24T23:16:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/6602","html_url":"https://github.com/django/django/pull/6602","diff_url":"https://github.com/django/django/pull/6602.diff","patch_url":"https://github.com/django/django/pull/6602.patch"},"body":"Patch for ticket https://code.djangoproject.com/ticket/26573"},"comment":{"url":"https://api.github.com/repos/django/django/issues/comments/221430183","html_url":"https://github.com/django/django/pull/6602#issuecomment-221430183","issue_url":"https://api.github.com/repos/django/django/issues/6602","id":221430183,"user":{"login":"inondle","id":12456116,"avatar_url":"https://avatars.githubusercontent.com/u/12456116?v=3","gravatar_id":"","url":"https://api.github.com/users/inondle","html_url":"https://github.com/inondle","followers_url":"https://api.github.com/users/inondle/followers","following_url":"https://api.github.com/users/inondle/following{/other_user}","gists_url":"https://api.github.com/users/inondle/gists{/gist_id}","starred_url":"https://api.github.com/users/inondle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inondle/subscriptions","organizations_url":"https://api.github.com/users/inondle/orgs","repos_url":"https://api.github.com/users/inondle/repos","events_url":"https://api.github.com/users/inondle/events{/privacy}","received_events_url":"https://api.github.com/users/inondle/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T23:16:27Z","updated_at":"2016-05-24T23:16:27Z","body":"@timgraham \r\n\r\nSo I think I've figured out this weird behavior. The issue is caused by the fact that when the parser is going through each template tag it selects a certain function[1] to evaluate each type of token. When it encounters an `{% if ... %}` tag it selects the `do_if` function in defaulttags.py[2]. \r\n\r\nThis function runs through the whole if/elif/else/endif series and checks all of these tags. If an error is raised in one of the tags following the `if` tag the parser will catch the error raised by `do_if` and raise another error with the `do_if` function's error embedded inside it. \r\n\r\nThese two errors, one from the parser and one from `do_if`, can have conflicting information as seen above. The parser was evaluating the `if` tag and reports that the error occurred there whereas the `do_if` function was evaluating the `else if` tag and reports the error there.\r\n\r\n[1] https://github.com/django/django/blob/2f0e0eee450775a71ac3eb42707dcd970ede42c8/django/template/base.py#L510\r\n[2] https://github.com/django/django/blob/2f0e0eee450775a71ac3eb42707dcd970ede42c8/django/template/defaulttags.py#L891"}}
{"actor":{"display_login":"inondle"}}