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

Group/about calls setup_template_variables with an empty context #1433

Closed
davidread opened this issue Jan 14, 2014 · 4 comments
Closed

Group/about calls setup_template_variables with an empty context #1433

davidread opened this issue Jan 14, 2014 · 4 comments
Assignees

Comments

@davidread
Copy link
Contributor

setup_template_variables is normally called supplying a context with model, session and user. However the Group About page seems an exception, where the context is {}.

https://github.com/okfn/ckan/blob/05c5c2cb260aa6b518bbd5ee2612f45780780cb1/ckan/controllers/group.py#L846

Is there any reason to deprive this of the model etc.? Is this a place where only logic methods should be called? Or can I add in the proper context here?

Specifically, this affects my hierarchy extension:
https://github.com/datagovuk/ckanext-hierarchy/blob/57ada7ba765881f2ffd696d25da30de69684c1bd/ckanext/hierarchy/plugin.py#L41

@ghost ghost assigned wardi Jan 21, 2014
@davidread
Copy link
Contributor Author

if @wardi could comment, I'll take it on

@wardi
Copy link
Contributor

wardi commented Jan 22, 2014

@davidread I added the call to _setup_template_variables because it was missing before 05c27ce and I needed it in my about page, but I didn't need any context values. I'm sure you're right, the context should be set up in the normal way instead.

@ghost ghost assigned davidread Jan 22, 2014
@davidread
Copy link
Contributor Author

Cheers Ian, I'll add this in then.

@davidread
Copy link
Contributor Author

PR now merged into master (and may go into CKAN 2.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants