BTHLABS-94: Pass is_netloc_banned from save to share extension

This commit is contained in:
2026-07-21 08:20:43 +02:00
parent 9565a71bc8
commit d90504eed9
15 changed files with 124 additions and 34 deletions

View File

@@ -2,6 +2,7 @@
from __future__ import annotations
import datetime
import typing
import uuid
import pydantic
@@ -50,6 +51,18 @@ class AssociationOut(ModelOut):
class AssociationWithTargetOut(AssociationOut):
target: SaveOut
@classmethod
def from_association_save(cls: typing.Type[typing.Self],
association: AssociationOut,
save: SaveOut,
) -> typing.Self:
return cls.model_validate(
obj={
**association.model_dump(by_alias=True),
'target': save,
},
)
@property
def title(self) -> str | None:
return self.get_title() or self.target.title