Skip to content

Commit

Permalink
utils: improve create_data
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Jul 2, 2024
1 parent 68383ce commit d5ef9eb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions invenio_records_lom/utils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,15 @@ def create_record(
do_publish: bool = True,
):
"""Create record."""
are_files = len(file_paths) > 0
draft = service.create(data=data, identity=identity, files=are_files)
data["files"] = {"enabled": len(file_paths) > 0}
data["access"] = {
"access": {
"record": "public",
"files": "public",
},
}

draft = service.create(data=data, identity=identity)

try:
for file_path in file_paths:
Expand Down

0 comments on commit d5ef9eb

Please sign in to comment.