Skip to content

Commit

Permalink
Modify the controller to just use the action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Babu committed Jan 9, 2014
1 parent d63b24e commit 1b61c68
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions ckan/controllers/user.py
Expand Up @@ -210,17 +210,7 @@ def cycle_apikey(self, id):
data_dict = {'id': id}

try:
check_access('user_update', context, data_dict)
except NotAuthorized:
abort(401, _('Unauthorized to edit a user.'))

try:
old_data = get_action('user_show')(context, data_dict)
old_data['apikey'] = model.types.make_uuid()
context['schema'] = schema.default_cycle_apikey_user_schema()
data_dict = old_data
get_action('user_update')(context, data_dict)

get_action('user_cycle_apikey')(context, data_dict)
except NotAuthorized:
abort(401, _('Unauthorized to edit user %s') % '')
except NotFound:
Expand Down

0 comments on commit 1b61c68

Please sign in to comment.