Object.as1: temporarily demote assert to warning log

pull/434/head
Ryan Barrett 2023-02-24 10:02:06 -06:00
rodzic 5463a74e7e
commit 76927ee487
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -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: