Skip to content

Commit

Permalink
Demo get_action wrapper with user controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Nov 20, 2012
1 parent 0de26f9 commit 408ec50
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions ckan/controllers/user.py
Expand Up @@ -75,9 +75,7 @@ def index(self):
c.q = request.params.get('q', '')
c.order_by = request.params.get('order_by', 'name')

context = {'model': model,
'user': c.user or c.author,
'return_query': True}
context = {'return_query': True}

data_dict = {'q': c.q,
'order_by': c.order_by}
Expand Down Expand Up @@ -198,9 +196,7 @@ def _save_new(self, context):
return render('user/logout_first.html')

def edit(self, id=None, data=None, errors=None, error_summary=None):
context = {'model': model, 'session': model.Session,
'user': c.user or c.author,
'save': 'save' in request.params,
context = {'save': 'save' in request.params,
'schema': self._edit_form_to_db_schema(),
}
if id is None:
Expand Down Expand Up @@ -308,9 +304,7 @@ def logged_in(self):
ckan.lib.i18n.set_lang(lang)

if c.user:
context = {'model': model,
'user': c.user}

context = None
data_dict = {'id': c.user}

user_dict = get_action('user_show')(context, data_dict)
Expand Down Expand Up @@ -469,8 +463,7 @@ def _get_form_password(self):
return password1

def followers(self, id=None):
context = {'model': model, 'session': model.Session,
'user': c.user or c.author, 'for_view': True}
context = {'for_view': True}
data_dict = {'id': id, 'user_obj': c.userobj}
self._setup_template_variables(context, data_dict)
f = get_action('user_follower_list')
Expand All @@ -496,8 +489,7 @@ def activity(self, id):
return render('user/activity_stream.html')

def dashboard(self, id=None):
context = {'model': model, 'session': model.Session,
'user': c.user or c.author, 'for_view': True}
context = {'for_view': True}
data_dict = {'id': id, 'user_obj': c.userobj}
self._setup_template_variables(context, data_dict)

Expand Down

0 comments on commit 408ec50

Please sign in to comment.