Skip to content

Commit

Permalink
Create new schema for related update
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelbabu committed Oct 21, 2013
1 parent ace4ca9 commit 4f6e390
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/logic/action/update.py
Expand Up @@ -132,7 +132,7 @@ def related_update(context, data_dict):
id = _get_or_bust(data_dict, "id")

session = context['session']
schema = context.get('schema') or schema_.default_related_schema()
schema = context.get('schema') or schema_.default_update_related_schema()

related = model.Related.get(id)
context["related"] = related
Expand Down
9 changes: 9 additions & 0 deletions ckan/logic/schema.py
Expand Up @@ -331,6 +331,15 @@ def default_related_schema():
return schema


def default_update_related_schema():
schema = default_related_schema()
schema['id'] = [not_empty, unicode]
schema['title'] = [ignore_missing, unicode]
schema['type'] = [ignore_missing, unicode]
schema['owner_id'] = [ignore_missing, unicode]
return schema


def default_extras_schema():

schema = {
Expand Down

0 comments on commit 4f6e390

Please sign in to comment.