Skip to content

Commit

Permalink
export xlsx publication: fix field has_open_access_file (#1395)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasfranck authored Mar 18, 2024
1 parent 81945e9 commit deacac3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions backends/excel/publication/publication_list_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import (
"io"
"strings"

"slices"

"github.com/ugent-library/biblio-backoffice/backends"
"github.com/ugent-library/biblio-backoffice/backends/excel"
"github.com/ugent-library/biblio-backoffice/models"
internal_time "github.com/ugent-library/biblio-backoffice/time"
"github.com/ugent-library/biblio-backoffice/vocabularies"
)

const sep = " ; "
Expand Down Expand Up @@ -222,7 +219,7 @@ func (x *xlsx) publicationToRow(pub *models.Publication) []string {
m["has_file"] = fmt.Sprintf("%t", len(pub.File) > 0)
m["has_open_access_file"] = "false"
for _, file := range pub.File {
if slices.Contains(vocabularies.Map["publication_file_access_levels"], file.AccessLevel) {
if file.AccessLevel == "info:eu-repo/semantics/openAccess" {
m["has_open_access_file"] = "true"
break
}
Expand Down

0 comments on commit deacac3

Please sign in to comment.