Skip to content

Commit

Permalink
[#98] return full response when adding file, overload create referenc…
Browse files Browse the repository at this point in the history
…ed file with no path
  • Loading branch information
sblack-usu committed Mar 1, 2019
1 parent 266b5d3 commit d624096
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hs_restclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def updateScienceMetadata(self, pid, metadata):
{"name":"hydroShareIdentifier","url":"http://www.hydroshare.org/resource/87ffb608900e407ab4b67d30c93b329e"}
],
"language":"eng",
"rights":"This resource is shared under the Creative Commons Attribution CC BY. http://creativecommons.org/licenses/by/4.0/",
"rights": {"statement": "This resource is shared under the Creative Commons Attribution CC BY." "url": "http://creativecommons.org/licenses/by/4.0/"},
"type":"http://www.hydroshare.org/terms/GenericResource",
"publisher":null,
"sources":[],
Expand Down Expand Up @@ -865,7 +865,7 @@ def addResourceFile(self, pid, resource_file, resource_filename=None, progress_c
raise HydroShareHTTPException((url, 'POST', r.status_code))

response = r.json()
assert(response['resource_id'] == pid)
# assert(response['resource_id'] == pid)

return response

Expand Down Expand Up @@ -1088,6 +1088,9 @@ def deleteResourceFolder(self, pid, pathname):

return r.json()

def createReferencedFile(self, pid, name, ref_url):
return self.createReferencedFile("", pid, name, ref_url)

def createReferencedFile(self, pid, path, name, ref_url):
"""Create a Referenced Content File (.url)
Expand Down

0 comments on commit d624096

Please sign in to comment.