Skip to content

Commit

Permalink
[#1178] Use model.State instead of core.State
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorbaptista committed Oct 12, 2013
1 parent dfd8ae9 commit bae4d47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ckan/logic/action/get.py
Expand Up @@ -15,7 +15,7 @@
import ckan.logic.schema
import ckan.lib.dictization.model_dictize as model_dictize
import ckan.lib.navl.dictization_functions
import ckan.model.core as core
import ckan.model as model
import ckan.model.misc as misc
import ckan.plugins as plugins
import ckan.lib.search as search
Expand Down Expand Up @@ -690,7 +690,7 @@ def user_list(context, data_dict):
)

# Filter deleted users
query = query.filter(model.User.state != core.State.DELETED)
query = query.filter(model.User.state != model.State.DELETED)

## hack for pagination
if context.get('return_query'):
Expand Down Expand Up @@ -1246,7 +1246,7 @@ def user_autocomplete(context, data_dict):
limit = data_dict.get('limit', 20)

query = model.User.search(q)
query = query.filter(model.User.state != core.State.DELETED)
query = query.filter(model.User.state != model.State.DELETED)
query = query.limit(limit)

user_list = []
Expand Down
4 changes: 2 additions & 2 deletions ckan/migration/versions/071_add_state_column_to_user_table.py
@@ -1,9 +1,9 @@
import ckan.model.core
import ckan.model


def upgrade(migrate_engine):
migrate_engine.execute(
'''
ALTER TABLE "user" ADD COLUMN "state" text NOT NULL DEFAULT '%s'
''' % ckan.model.core.State.ACTIVE
''' % ckan.model.State.ACTIVE
)

0 comments on commit bae4d47

Please sign in to comment.