Skip to content

Commit

Permalink
[#1583] don't replace action functions with calls to get_action
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Mar 6, 2014
1 parent 7588f45 commit 21d434e
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions ckan/logic/__init__.py
Expand Up @@ -447,22 +447,6 @@ def wrapped(context=None, data_dict=None, **kw):
fn.side_effect_free = True
_actions[action_name] = fn


def replaced_action(action_name):
def warn(context, data_dict):
log.critical('Action `%s` is being called directly '
'all action calls should be accessed via '
'logic.get_action' % action_name)
return get_action(action_name)(context, data_dict)
return warn

# Store our wrapped function so it is available. This is to prevent
# rewrapping of actions
module = sys.modules[_action.__module__]
r = replaced_action(action_name)
r.__replaced = fn
module.__dict__[action_name] = r

return _actions.get(action)


Expand Down

0 comments on commit 21d434e

Please sign in to comment.