kopia lustrzana https://gitlab.com/jaywink/federation
Loosen validation of `TargetIDMixin`
It now requires one of the target attributes to be set, not just `target_id`. This fixes follows over the Diaspora protocol which broke with stricter send validation added in 0.19.0.merge-requests/159/merge
rodzic
dd55916978
commit
6bc85a3bfa
|
@ -17,7 +17,11 @@
|
|||
* Don't crash when parsing an invalid NodeInfo document where the usage dictionary
|
||||
is not following specification.
|
||||
|
||||
* Ensure Pixelfed, Kroeg and Kibou instances that emulate the Mastodon API don't get identified as Mastodon instances.
|
||||
* Ensure Pixelfed, Kroeg and Kibou instances that emulate the Mastodon API don't get identified as Mastodon instances.
|
||||
|
||||
* Loosen validation of `TargetIDMixin`, it now requires one of the target attributes
|
||||
to be set, not just `target_id`. This fixes follows over the Diaspora protocol which
|
||||
broke with stricter send validation added in 0.19.0.
|
||||
|
||||
## [0.19.0] - 2019-12-15
|
||||
|
||||
|
|
|
@ -148,9 +148,11 @@ class TargetIDMixin(BaseEntity):
|
|||
target_handle = ""
|
||||
target_guid = ""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self._required += ["target_id"]
|
||||
def validate(self, *args, **kwargs) -> None:
|
||||
super().validate(*args, **kwargs)
|
||||
# Ensure one of the target attributes is filled at least
|
||||
if not self.target_id and not self.target_handle and not self.target_guid:
|
||||
raise ValueError("Must give one of the target attributes for TargetIDMixin.")
|
||||
|
||||
|
||||
class RootTargetIDMixin(BaseEntity):
|
||||
|
|
Ładowanie…
Reference in New Issue