kopia lustrzana https://github.com/snarfed/bridgy-fed
Object.as1: temporarily demote assert to warning log
rodzic
5463a74e7e
commit
76927ee487
|
@ -286,8 +286,12 @@ class Object(StringIdModel):
|
|||
|
||||
@ComputedJsonProperty
|
||||
def as1(self):
|
||||
assert (self.as2 is not None) ^ (self.bsky is not None) ^ (self.mf2 is not None), \
|
||||
f'{self.as2} {self.bsky} {self.mf2}'
|
||||
# TODO: switch back to assert
|
||||
# assert (self.as2 is not None) ^ (self.bsky is not None) ^ (self.mf2 is not None), \
|
||||
# f'{self.as2} {self.bsky} {self.mf2}'
|
||||
if (self.as2 is not None) ^ (self.bsky is not None) ^ (self.mf2 is not None):
|
||||
logging.warning(f'{self.key} has multiple! {self.as2 is not None} {self.bsky is not None} {self.mf2 is not None}')
|
||||
|
||||
if self.as2 is not None:
|
||||
return as2.to_as1(common.redirect_unwrap(self.as2))
|
||||
elif self.bsky is not None:
|
||||
|
|
Ładowanie…
Reference in New Issue