reduce fieldname checks on construction of sombrero OutgoingActivity

to "type" only. The others might not have been generated yet.
trilby-heavy
Marnanel Thurman 2020-05-07 17:29:30 +01:00
rodzic 7c87961648
commit 25b00216cb
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -39,10 +39,10 @@ class OutgoingActivity(models.Model):
if not isinstance(self.content, str):
for field in ['type', 'actor', 'to']:
for field in ['type',]:
if field not in self.content:
raise ValueError("activity is missing required fields: %s",
self.content)
raise ValueError("activity is missing required fields: "+\
str(self.content))
self.content = json.dumps(self.content)