Skip to content

Commit

Permalink
Changes according revieew
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Aug 6, 2018
1 parent 110e43d commit 8210da1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ckan/lib/dictization/model_save.py
Expand Up @@ -33,9 +33,8 @@ def resource_dict_save(res_dict, context):
fields = [field.name for field in table.c]

# Strip the full url for resources of type 'upload'
if res_dict.get('url_type') == u'upload':
url = res_dict.get('url')
res_dict[u'url'] = url[url.rfind(u"/")+1:]
if res_dict.get('url') and res_dict.get('url_type') == u'upload':
res_dict['url'] = res_dict['url'].rsplit('/')[-1]

# Resource extras not submitted will be removed from the existing extras
# dict
Expand Down

0 comments on commit 8210da1

Please sign in to comment.