Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org / group search is case sensitive #594

Merged
merged 1 commit into from Mar 20, 2013

Conversation

tobes
Copy link
Contributor

@tobes tobes commented Mar 20, 2013

Please make this not so. Makes the search confusing and unusable until you discover why it's not just working.

If this is difficult to fix, then we need to add some text to say 'search is case sensitive'

@tobes
Copy link
Contributor

tobes commented Mar 14, 2013

diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py
index 46ff233..b1240a9 100644
--- a/ckan/logic/action/get.py
+++ b/ckan/logic/action/get.py
@@ -334,9 +334,9 @@ def _group_or_org_list(context, data_dict, is_org=False):
     if q:
         q = u'%{0}%'.format(q)
         query = query.filter(_or_(
-            model.GroupRevision.name.like(q),
-            model.GroupRevision.title.like(q),
-            model.GroupRevision.description.like(q),
+            model.GroupRevision.name.ilike(q),
+            model.GroupRevision.title.ilike(q),
+            model.GroupRevision.description.ilike(q),
         ))

this is an easy fix but sqlite will choke

@shevski
Copy link
Author

shevski commented Mar 14, 2013

Ok thanks, who is the right person to do this? We need it at lease for geodatagov extension

@tobes
Copy link
Contributor

tobes commented Mar 14, 2013

@shevski this is a work in progress as it breaks sqlite. We could use in an emergency but we need to do things properly. So that is just a comment

@tobes
Copy link
Contributor

tobes commented Mar 14, 2013

@shevski I've changed this from ux to bug. the ux is fine it just doesn't do what is wanted :)

@ghost ghost assigned kindly Mar 20, 2013
@tobes
Copy link
Contributor

tobes commented Mar 20, 2013

@kindly can we get this into master and the dg branch. Also I think a 2.0 backport does no harm and is a simple change

kindly added a commit that referenced this pull request Mar 20, 2013
@kindly kindly merged commit 2f46e34 into master Mar 20, 2013
tobes added a commit that referenced this pull request Mar 20, 2013
@amercader
Copy link
Member

@tobes This sounds like something worth fixing for 2.0. Can you do a backport if it is easy? I get conflicts merging this particular commit

@tobes
Copy link
Contributor

tobes commented Mar 26, 2013

@amercader I'll do a specific 2.0 fix for you

@tobes
Copy link
Contributor

tobes commented Mar 26, 2013

@amercader this is not valid for 2.0 as there is no group/org search that is 2.1 only

@smotornyuk smotornyuk deleted the 594-case-insensitive-group-org-search branch December 19, 2018 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants