mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 00:09:17 +02:00
See #192: replaced old stats endpoint with nodeinfo
This commit is contained in:
parent
e31bed050e
commit
b4ad7a4a71
7 changed files with 239 additions and 15 deletions
|
@ -4,6 +4,9 @@ from rest_framework.response import Response
|
|||
from dynamic_preferences.api import serializers
|
||||
from dynamic_preferences.registries import global_preferences_registry
|
||||
|
||||
from funkwhale_api.common import preferences
|
||||
|
||||
from . import nodeinfo
|
||||
from . import stats
|
||||
|
||||
|
||||
|
@ -27,10 +30,12 @@ class InstanceSettings(views.APIView):
|
|||
return Response(data, status=200)
|
||||
|
||||
|
||||
class InstanceStats(views.APIView):
|
||||
class NodeInfo(views.APIView):
|
||||
permission_classes = []
|
||||
authentication_classes = []
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
data = stats.get()
|
||||
if not preferences.get('instance__nodeinfo_enabled'):
|
||||
return Response(status=404)
|
||||
data = nodeinfo.get()
|
||||
return Response(data, status=200)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue