Skip to content

Commit

Permalink
[#2437] Fix related schema. Featured should be integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Murray committed Jul 25, 2012
1 parent 7fd115f commit c2e7c67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckan/logic/schema.py
Expand Up @@ -272,7 +272,7 @@ def default_related_schema():
'url': [ignore_missing, unicode, url_validator],
'owner_id': [not_empty, unicode],
'created': [ignore],
'featured': [ignore_missing, unicode],
'featured': [ignore_missing, int],
}
return schema

Expand Down
4 changes: 2 additions & 2 deletions ckan/tests/functional/test_related.py
Expand Up @@ -116,7 +116,7 @@ def test_related_create_featured_as_sysadmin(self):

result = logic.get_action("related_create")(context, data_dict)

assert_equal(result['featured'], '1')
assert_equal(result['featured'], 1)

def test_related_create_featured_as_non_sysadmin_fails(self):
'''Non-sysadmin users should not be able to create featured relateds'''
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_related_create_not_featured_as_non_sysadmin_succeeds(self):

result = logic.get_action("related_create")(context, data_dict)

assert_equal(result['featured'], '0')
assert_equal(result['featured'], 0)

def test_related_create_featured_empty_as_non_sysadmin_succeeds(self):
'''Non-sysadmins can leave featured empty.'''
Expand Down

0 comments on commit c2e7c67

Please sign in to comment.