Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: added service schema from config #1883

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions invenio_rdm_records/resources/serializers/bibtex/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def _fetch_fields_map(self, data):
"pages": data.get("pages", None),
"note": data.get("note", None),
"venue": data.get("venue", None),
"swhid": data.get("swhid", None),
}

def _format_output_row(self, field, value):
Expand All @@ -261,10 +262,10 @@ def _format_output_row(self, field, value):

elif len(value) > 50:
wrapped = textwrap.wrap(value, 50)
out = " {0:<12} = {{{{{1} \n".format(field, wrapped[0])
for line in wrapped[1:-1]:
out += " {0:<17} {1:<}\n".format("", line)
out += " {0:<17} {1:<}}}}},\n".format("", wrapped[-1])
out = f" {field:<12} = {{{wrapped[0]}\n"
for line in wrapped[1:]:
out += f" {'' :<17} {line}\n"
out += f" {'' :<17}}},\n" # Closing the single brace here
elif field == "month":
out = " {0:<12} = {1},\n".format(field, value)
elif field == "url":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class BibTexFormatter:
"version",
"doi",
"url",
"swhid",
],
}
"""Computer software."""
4 changes: 2 additions & 2 deletions invenio_rdm_records/services/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class RDMRecordServiceConfig(RecordServiceConfig, ConfiguratorMixin):
draft_cls = FromConfig("RDM_DRAFT_CLS", default=RDMDraft)

# Schemas
schema = RDMRecordSchema
schema = FromConfig("RDM_RECORD_SCHEMA", default=RDMRecordSchema)
schema_parent = RDMParentSchema
schema_access_settings = AccessSettingsSchema
schema_secret_link = SecretLinkSchema
Expand Down Expand Up @@ -647,7 +647,7 @@ class RDMCommunityRecordsConfig(BaseRecordServiceConfig, ConfiguratorMixin):

# Service schemas
community_record_schema = CommunityRecordsSchema
schema = RDMRecordSchema
schema = FromConfig("RDM_RECORD_SCHEMA", default=RDMRecordSchema)

# Max n. records that can be removed at once
max_number_of_removals = 10
Expand Down