Skip to content

Commit

Permalink
fix federated status update
Browse files Browse the repository at this point in the history
  • Loading branch information
Her Email committed Nov 19, 2023
1 parent fad290e commit b2e7a71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion catalog/book/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class EditionInSchema(ItemInSchema):
pub_month: int | None = None
binding: str | None = None
price: str | None = None
pages: str | None = None
pages: int | str | None = None
series: str | None = None
imprint: str | None = None

Expand Down
2 changes: 1 addition & 1 deletion neodb-takahe
18 changes: 9 additions & 9 deletions takahe/ap_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,22 @@

def _parse_item_links(objects):
logger.debug(f"Parsing item links from {objects}")
if not objects:
return []
objs = objects if isinstance(objects, list) else [objects]
items = [
obj["href"]
for obj in objects
if obj["type"] in _supported_ap_catalog_item_types
obj["href"] for obj in objs if obj["type"] in _supported_ap_catalog_item_types
]
return items


def _parse_piece_objects(objects):
logger.debug(f"Parsing pieces from {objects}")
if not objects:
return []
objs = objects if isinstance(objects, list) else [objects]
pieces = []
for obj in objects:
for obj in objs:
if obj["type"] in _supported_ap_journal_types.keys():
pieces.append(obj)
else:
Expand Down Expand Up @@ -96,11 +100,7 @@ def _update_or_create_post(pk, obj):
cls.update_by_ap_object(owner, item, p, pk, _get_visibility(post.visibility))


def post_created(pk, obj):
_update_or_create_post(pk, obj)


def post_updated(pk, obj):
def post_fetched(pk, obj):
_update_or_create_post(pk, obj)


Expand Down

0 comments on commit b2e7a71

Please sign in to comment.