hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Failed to update some metadata terms #97

Closed zhiyuli closed 5 years ago

zhiyuli commented 5 years ago
    No error received. But they didnt get updated. 

    # not working!!!!
    # hs rights/license
    right_dict = {'statement': 'This is the rights statement for this resource',
                        'url': 'http://rights.ord/001', }
    science_metadata_json =hs.updateScienceMetadata( resource_id, metadata={'rights': [right_dict]})      

    # not working !!!!
    # hs funding
    agent_dict = {"agency_name": "National Science Foundation",
                  "award_title": "CZO",
                  "award_number": "NSF_123456789",
                  "agency_url": "http://www.nsf.gov",}
    science_metadata_json =hs.updateScienceMetadata( resource_id,  metadata={'funding_agencies': [agent_dict]})
sblack-usu commented 5 years ago

The rest_api parses this incorrectly and places your dict inside the statement key... https://github.com/hydroshare/hydroshare/blob/develop/hs_core/models.py#L3528 It's an easy enough fix to put it in the correct key.

sblack-usu commented 5 years ago

Moving this work to hydroshare. https://github.com/hydroshare/hydroshare/issues/3088