Skip to content

Commit

Permalink
Fix context dicts in user controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Jun 4, 2012
1 parent 2b708ac commit ba4d37c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckan/controllers/user.py
Expand Up @@ -63,9 +63,6 @@ def _setup_follow_button(self, context):
{'id': c.user_dict['id']})

def _setup_template_variables(self, context, data_dict):
context = {'model': context.get('model'),
'session': context.get('session'),
'user': context.get('user')}
c.is_sysadmin = Authorizer().is_sysadmin(c.user)
try:
user_dict = get_action('user_show')(context, data_dict)
Expand Down Expand Up @@ -246,7 +243,8 @@ def edit(self, id=None, data=None, errors=None, error_summary=None):
errors = errors or {}
vars = {'data': data, 'errors': errors, 'error_summary': error_summary}

self._setup_template_variables(context, data_dict)
self._setup_template_variables({'model': model,
'session': model.Session, 'user': c.user or c.author}, data_dict)

c.is_myself = True
c.form = render(self.edit_user_form, extra_vars=vars)
Expand Down

0 comments on commit ba4d37c

Please sign in to comment.