Skip to content

Commit

Permalink
Quick fix for deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 1, 2012
1 parent b7f7a80 commit 3ee836d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ckan/lib/maintain.py
Expand Up @@ -64,7 +64,9 @@ def deprecate_context_item(item_name, message=''):

def get_item(self):
log.warning('c.%s has been deprecated. %s', item_name, message)
return getattr(c._current_obj(), item_name)
return getattr(c.__ckan_deprecated__, item_name)

setattr(c.__class__, item_name, property(get_item))
c.__ckan_deprecated__ = c.__ckan_deprecated__ or {}
c.__ckan_deprecated__[item_name] = getattr(c, item_name)
setattr(c, item_name, property(get_item))

0 comments on commit 3ee836d

Please sign in to comment.