1
0
Fork 0

Fixes federation bugs

This commit is contained in:
Mouse Reeve 2020-10-30 15:22:20 -07:00
parent 6e97592518
commit a17f54e457
7 changed files with 30 additions and 24 deletions

View file

@ -1,4 +1,5 @@
''' base model with default fields '''
from datetime import datetime
from base64 import b64encode
from dataclasses import dataclass
from typing import Callable
@ -69,6 +70,8 @@ class ActivitypubMixin:
value = getattr(self, mapping.model_key)
if hasattr(value, 'remote_id'):
value = value.remote_id
if isinstance(value, datetime):
value = value.isoformat()
fields[mapping.activity_key] = mapping.activity_formatter(value)
if pure: