Skip to content

Commit

Permalink
fix model import in lib helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 10, 2012
1 parent 1ce3225 commit 1565758
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ckan/lib/helpers.py
Expand Up @@ -33,6 +33,7 @@
from pylons import c
from pylons.i18n import _

import ckan.model as model
get_available_locales = i18n.get_available_locales
get_locales_dict = i18n.get_locales_dict

Expand Down Expand Up @@ -410,12 +411,10 @@ def am_authorized(c, action, domain_object=None):
''' Deprecated. Please use check_access instead'''
from ckan.authz import Authorizer
if domain_object is None:
from ckan import model
domain_object = model.System()
return Authorizer.am_authorized(c, action, domain_object)

def check_access(action, data_dict=None):
from ckan import model
from ckan.logic import check_access as check_access_logic,NotAuthorized

context = {'model': model,
Expand All @@ -430,7 +429,6 @@ def check_access(action, data_dict=None):
return authorized

def linked_user(user, maxlength=0):
from ckan import model
if user in [model.PSEUDO_USER__LOGGED_IN, model.PSEUDO_USER__VISITOR]:
return user
if not isinstance(user, model.User):
Expand All @@ -448,7 +446,6 @@ def linked_user(user, maxlength=0):
url_for(controller='user', action='read', id=_name))

def linked_authorization_group(authgroup, maxlength=0):
from ckan import model
if not isinstance(authgroup, model.AuthorizationGroup):
authgroup_name = unicode(authgroup)
authgroup = model.AuthorizationGroup.get(authgroup_name)
Expand All @@ -462,7 +459,6 @@ def linked_authorization_group(authgroup, maxlength=0):
url_for(controller='authorization_group', action='read', id=displayname))

def group_name_to_title(name):
from ckan import model
group = model.Group.by_name(name)
if group is not None:
return group.display_name
Expand Down Expand Up @@ -788,7 +784,6 @@ def process_names(items):
'message' : revision.message,}
return rev
import lib.dictization.model_dictize as md
import ckan.model as model
converters = {'package' : md.package_dictize,
'revisions' : dictize_revision_list}
converter = converters[object_type]
Expand Down

0 comments on commit 1565758

Please sign in to comment.