Commit 1560fc11 authored by Andreas Wagner's avatar Andreas Wagner
Browse files

Add comments about sandbox vs final prefix.

parent 2fc23bd6
......@@ -228,7 +228,7 @@ func ResolveDOI(doi string, md *tei2zenodo.ZMetadata, conf *tei2zenodo.RepoConfi
// PostFile posts a file to zenodo, taking the id from the md.DOI field
// it returns an URI for the upload and an error value
func PostFile(r io.Reader, filename string, md *tei2zenodo.ZMetadata, conf *tei2zenodo.RepoConfig) (string, error) {
if md.DOI[:15] != "10.5072/zenodo." { // not a zenodo doi
if md.DOI[:15] != "10.5072/zenodo." { // not a zenodo doi (the pattern is for sandbox, the final prefix is 10.5281)
log.Printf("Problem: DOI %s is not a zenodo DOI.", md.DOI)
return "", fmt.Errorf("invalid DOI value")
}
......@@ -312,7 +312,7 @@ func PostFile(r io.Reader, filename string, md *tei2zenodo.ZMetadata, conf *tei2
// PutMetadata adds metadata to an existing deposit and returns an error value
func PutMetadata(md *tei2zenodo.ZMetadata, conf *tei2zenodo.RepoConfig) error {
if md.DOI[:15] != "10.5072/zenodo." { // not a zenodo doi
if md.DOI[:15] != "10.5072/zenodo." { // not a zenodo doi (the pattern is for sandbox, the final prefix is 10.5281)
log.Printf("Problem: DOI is not a zenodo DOI.")
return fmt.Errorf("invalid DOI value")
}
......@@ -375,7 +375,7 @@ func PutMetadata(md *tei2zenodo.ZMetadata, conf *tei2zenodo.RepoConfig) error {
// Publish instructs zenodo to publish the deposit described in md and returns an error value
func Publish(md *tei2zenodo.ZMetadata, conf *tei2zenodo.RepoConfig) error {
if md.DOI[:15] != "10.5072/zenodo." { // not a zenodo doi
if md.DOI[:15] != "10.5072/zenodo." { // not a zenodo doi (the pattern is for sandbox, the final prefix is 10.5281)
log.Printf("Problem: DOI %s is not a zenodo DOI.", md.DOI)
return fmt.Errorf("invalid DOI value")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment