Skip to content

Commit

Permalink
Make end in DateRangeSchema not required
Browse files Browse the repository at this point in the history
  • Loading branch information
ejimsan committed Dec 15, 2024
1 parent da7eca5 commit 83e502a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ebl/fragmentarium/application/date_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _deserialize(self, date_string: str, *args, **kwargs) -> datetime.date:


class PartialDateSchema(Schema):
year = fields.Integer(required=True)
year = fields.Integer(allow_none=True)
month = fields.Integer(allow_none=True)
day = fields.Integer(allow_none=True)
notes = fields.String(allow_none=True, load_default="")
Expand All @@ -29,7 +29,7 @@ def remove_empty_fields(self, data: dict, **kwargs):

class DateRangeSchema(Schema):
start = fields.Nested(PartialDateSchema, allow_none=True)
end = fields.Nested(PartialDateSchema, allow_none=True)
end = fields.Nested(PartialDateSchema, allow_none=True, required=False)
notes = fields.String(allow_none=True)

@post_load
Expand Down

0 comments on commit 83e502a

Please sign in to comment.