Skip to content

Commit

Permalink
[#1506]: Force format field to be lowercase in resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
teajaymars committed Feb 28, 2012
1 parent f4dd3b9 commit da3edd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -79,6 +79,7 @@ def extras_list_dictize(extras_list, context):

def resource_dictize(res, context):
resource = table_dictize(res, context)
resource['format'] = resource.get('format','').lower()
extras = resource.pop("extras", None)
if extras:
resource.update(extras)
Expand Down
2 changes: 1 addition & 1 deletion ckan/logic/action/get.py
Expand Up @@ -625,7 +625,7 @@ def format_autocomplete(context, data_dict):
.order_by('total DESC')\
.limit(limit)

return [resource.format for resource in query]
return [resource.format.lower() for resource in query]

def user_autocomplete(context, data_dict):
'''Returns users containing the provided string'''
Expand Down

0 comments on commit da3edd4

Please sign in to comment.