See #170: admin UI for channels, reporting channels

This commit is contained in:
Eliot Berriot 2020-03-31 10:45:41 +02:00
parent ae52969efe
commit 102c90d499
32 changed files with 1106 additions and 77 deletions

View file

@ -266,5 +266,11 @@ def get_object_by_fid(fid, local=None):
if not result:
raise ObjectDoesNotExist()
model = apps.get_model(*result["__type"].split("."))
instance = model.objects.get(fid=fid)
if model._meta.label == "federation.Actor":
channel = instance.get_channel()
if channel:
return channel
return apps.get_model(*result["__type"].split(".")).objects.get(fid=fid)
return instance