Skip to content

Commit

Permalink
global: add missing docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Sep 6, 2023
1 parent 4fdae19 commit 9937eb9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions site/zenodo_rdm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@


class DraftRecordIdProvider(RecordIdProvider):
"""Draft numerical auto-incrementing record ID provider."""

default_status_with_obj = PIDStatus.NEW

@classmethod
Expand All @@ -33,10 +35,14 @@ def create(cls, object_type=None, object_uuid=None, options=None, **kwargs):


class ZenodoRDMParent(RDMParent):
"""Zenodo RDMParent API class."""

pid = PIDField("id", provider=DraftRecordIdProvider, delete=True)


class ZenodoRDMRecord(RDMRecord):
"""Zenodo RDMRecord API class."""

pid = PIDField("id", provider=DraftRecordIdProvider, delete=True)
parent_record_cls = ZenodoRDMParent

Expand All @@ -46,6 +52,8 @@ class ZenodoRDMRecord(RDMRecord):


class ZenodoRDMDraft(RDMDraft):
"""Zenodo RDMDraft API class."""

pid = PIDField("id", provider=DraftRecordIdProvider, delete=False)
parent_record_cls = ZenodoRDMParent

Expand Down
1 change: 1 addition & 0 deletions site/zenodo_rdm/legacy/deserializers/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Meta:

@pre_load()
def load_default_license(self, data, **kwargs):
"""Load default license."""
metadata = data.get("metadata", {})
if metadata and "license" not in metadata:
metadata = data.setdefault("metadata", {})
Expand Down
2 changes: 2 additions & 0 deletions site/zenodo_rdm/legacy/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class LegacyListSchema(BaseListSchema):
"""Legacy top-level array/list schema."""

class Meta:
"""Meta class."""

exclude = ("aggregations",)

@post_dump()
Expand Down
1 change: 1 addition & 0 deletions site/zenodo_rdm/legacy/serializers/schemas/zenodojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def dump_communities(self, obj):
return missing

def dump_alternate_identifiers(self, obj):
"""Dump alternate identifiers."""
result = []
rel_id_schema = common.RelatedIdentifierSchema(exclude=("relation",))
alternate_identifiers = obj.get("identifiers", [])
Expand Down

0 comments on commit 9937eb9

Please sign in to comment.