Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Fix record dates
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Mar 11, 2024
1 parent 176d4e7 commit 0a81312
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/records/schemas/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Record(Details):
administrative_background: str | None = None
arrangement: str | None = None
date: str | None = None
date_from: str | None = None
date_to: str | None = None
is_digitised: bool | None = None
held_by: dict = {}
creators: list[dict] = []
Expand Down
7 changes: 5 additions & 2 deletions app/sources/rosetta/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def parse_results(self, raw_results, source_url):
try:
parsed_data = RosettaResponseParser(raw_results)
except Exception:
raise Exception("Respone is not recognised")
raise Exception("Response is not recognised")
if (
parsed_data.type() == "record"
or parsed_data.type() == "aggregation"
Expand All @@ -170,7 +170,9 @@ def parse_results(self, raw_results, source_url):
parsed_data.administrative_background()
)
record.arrangement = parsed_data.arrangement()
record.date = parsed_data.date_range()
record.date = parsed_data.date()
record.date_from = parsed_data.date_from()
record.date_to = parsed_data.date_to()
record.is_digitised = parsed_data.is_digitised()
record.held_by = parsed_data.held_by()
record.creators = parsed_data.creators()
Expand All @@ -190,6 +192,7 @@ def parse_results(self, raw_results, source_url):
else []
)
record.source_url = source_url
print(record.toJSON())
return record.toJSON()
if (
parsed_data.type() == "archive"
Expand Down

0 comments on commit 0a81312

Please sign in to comment.