Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to access non-existing helpers should raise HelperException #3041

Closed
brew opened this issue May 20, 2016 · 1 comment
Closed

Attempting to access non-existing helpers should raise HelperException #3041

brew opened this issue May 20, 2016 · 1 comment
Assignees

Comments

@brew
Copy link
Member

@brew brew commented May 20, 2016

CKAN Version if known (or site URL)

2.6a, master

Please describe the expected behaviour

If helper function is called in a template, but the function doesn't exist, a ckan.exceptions.HelperError should be raised.

Please describe the actual behaviour

A jinja.exceptions.UndefinedError is raised.

What steps can be taken to reproduce the issue?

Add {{ h.not_here() }} to the base.html template and request the index page.

PR on its way.

brew added a commit that referenced this issue May 20, 2016
Fixes exception handling introduced in #2908, by fixing call to super
class's __getitem__ and catching correct exception in
HelperAttributeDict.

Tests added for rendering helpers in templates, and using helpers from
toolkit.
@TkTech
Copy link
Member

@TkTech TkTech commented May 20, 2016

👍

@wardi wardi self-assigned this May 24, 2016
@wardi wardi closed this in #3042 May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants