Skip to content

Commit

Permalink
Merge pull request #1218 from okfn/1218-remove-__extras
Browse files Browse the repository at this point in the history
Hide __extras from extras on package_show
  • Loading branch information
kindly committed Nov 28, 2013
2 parents edda21c + cd580c6 commit fb0fcf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions ckan/logic/schema.py
Expand Up @@ -351,6 +351,7 @@ def default_extras_schema():
'state': [ignore],
'deleted': [ignore_missing],
'revision_timestamp': [ignore],
'__extras': [ignore],
}
return schema

Expand Down
12 changes: 6 additions & 6 deletions ckan/tests/functional/api/test_activity.py
Expand Up @@ -573,17 +573,17 @@ def _update_extra(self, package_dict, user):
[group['name'] for group in package_dict['groups']],
apikey=apikey)

extras_before = package_dict['extras']
import copy
extras_before = copy.deepcopy(package_dict['extras'])
assert len(extras_before) > 0, (
"Can't update an extra if the package doesn't have any")

# Update the package's first extra.
extras = list(extras_before)
if extras[0]['value'] != '"edited"':
extras[0]['value'] = '"edited"'
if package_dict['extras'][0]['value'] != '"edited"':
package_dict['extras'][0]['value'] = '"edited"'
else:
assert extras[0]['value'] != '"edited again"'
extras[0]['value'] = '"edited again"'
assert package_dict['extras'][0]['value'] != '"edited again"'
package_dict['extras'][0]['value'] = '"edited again"'
updated_package = package_update(self.app, package_dict,
user['apikey'])

Expand Down

0 comments on commit fb0fcf1

Please sign in to comment.