Simplify ObjectMixin broadcast kwarg

This commit is contained in:
Bart Schuurmans 2024-04-25 10:31:24 +02:00
parent 77832cbec7
commit 7604d0acdb

View file

@ -206,14 +206,10 @@ class ObjectMixin(ActivitypubMixin):
created: Optional[bool] = None, created: Optional[bool] = None,
software: Any = None, software: Any = None,
priority: str = BROADCAST, priority: str = BROADCAST,
broadcast: bool = True,
**kwargs: Any, **kwargs: Any,
) -> None: ) -> None:
"""broadcast created/updated/deleted objects as appropriate""" """broadcast created/updated/deleted objects as appropriate"""
broadcast = kwargs.get("broadcast", True)
# this bonus kwarg would cause an error in the base save method
if "broadcast" in kwargs:
del kwargs["broadcast"]
created = created or not bool(self.id) created = created or not bool(self.id)
# first off, we want to save normally no matter what # first off, we want to save normally no matter what
super().save(*args, **kwargs) super().save(*args, **kwargs)