Skip to content

Commit

Permalink
fix: new subject value
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Dec 17, 2023
1 parent 54edd0d commit 85e7424
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rpc/timeline_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

BatchMeme: pydantic.TypeAdapter[dict[int, Any]] = pydantic.TypeAdapter(dict[int, Any])

BatchSubjectImage: pydantic.TypeAdapter[dict[int, Any]] = pydantic.TypeAdapter(
dict[int, Any]
BatchSubjectImage: pydantic.TypeAdapter[dict[int, SubjectImage]] = pydantic.TypeAdapter(
dict[int, SubjectImage]
)


Expand Down Expand Up @@ -113,15 +113,15 @@ def merge_previous_timeline(
img = BatchSubjectImage.validate_python(phpseralize.loads(tl.img.encode()))
else:
i = SubjectImage.model_validate(phpseralize.loads(tl.img.encode()))
img = {int(i.subject_id): i.model_dump}
img = {int(i.subject_id): i}

img[req.subject.id] = SubjectImage(
subject_id=str(req.subject.id), images=req.subject.image
).model_dump()
)

tl.batch = 1
tl.memo = php.serialize(memo)
tl.img = php.serialize(img)
tl.img = php.serialize({key: value.model_dump() for key, value in img.items()})

session.add(tl)

Expand Down

0 comments on commit 85e7424

Please sign in to comment.