See #890: expose number of reports linked to tracks, albums, libraries, accounts and artists via the /stats route

This commit is contained in:
Eliot Berriot 2019-09-13 05:53:40 +02:00
parent d4deb830c0
commit 9552b49a46
12 changed files with 73 additions and 2 deletions

View file

@ -10,6 +10,7 @@ from django.dispatch import receiver
from django.urls import reverse
from django.utils import timezone
from funkwhale_api.common import models as common_models
from funkwhale_api.federation import models as federation_models
from funkwhale_api.federation import utils as federation_utils
@ -152,6 +153,8 @@ class Report(federation_models.FederationMixin):
"Note", content_type_field="target_content_type", object_id_field="target_id"
)
objects = common_models.GenericTargetQuerySet.as_manager()
def get_federation_id(self):
if self.fid:
return self.fid