def update_ezid_metadata_on_change(target_object, status): if (settings.EZID_USERNAME and settings.EZID_PASSWORD) and target_object.get_identifier('doi'): client = get_ezid_client() doi, metadata = build_ezid_metadata(target_object) client.change_status_identifier(status, doi, metadata)
def update_ezid_metadata_on_change(target_guid, status): Guid = apps.get_model('osf.Guid') target_object = Guid.load(target_guid).referent if (settings.EZID_USERNAME and settings.EZID_PASSWORD) and target_object.get_identifier('doi'): client = get_ezid_client() doi, metadata = build_ezid_metadata(target_object) client.change_status_identifier(status, doi, metadata)
def osf_admin_change_status_identifier(node, status): if node.get_identifier_value('doi') and node.get_identifier_value('ark'): doi, metadata = build_ezid_metadata(node) client = EzidClient(settings.EZID_USERNAME, settings.EZID_PASSWORD) client.change_status_identifier(status, doi, metadata)