code style cleanup
This commit is contained in:
@ -44,12 +44,13 @@ def nodeinfo_pointer(request):
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
def nodeinfo(request):
|
||||
''' basic info about the server '''
|
||||
if request.method != 'GET':
|
||||
return HttpResponseNotFound()
|
||||
|
||||
status_count = models.Status.objects.count()
|
||||
status_count = models.Status.objects.filter(user__local=True).count()
|
||||
user_count = models.User.objects.count()
|
||||
return JsonResponse({
|
||||
"version": "2.0",
|
||||
@ -66,13 +67,12 @@ def nodeinfo(request):
|
||||
"activeMonth": user_count, # TODO
|
||||
"activeHalfyear": user_count, # TODO
|
||||
},
|
||||
"localPosts": status_count, # TODO: mark local
|
||||
"localPosts": status_count,
|
||||
},
|
||||
"openRegistrations": True,
|
||||
})
|
||||
|
||||
|
||||
|
||||
def instance_info(request):
|
||||
''' what this place is TODO: should be settable/editable '''
|
||||
if request.method != 'GET':
|
||||
@ -98,3 +98,13 @@ def instance_info(request):
|
||||
'registrations': True,
|
||||
'approval_required': False,
|
||||
})
|
||||
|
||||
|
||||
def peers(request):
|
||||
''' list of federated servers this instance connects with '''
|
||||
if request.method != 'GET':
|
||||
return HttpResponseNotFound()
|
||||
|
||||
# TODO
|
||||
return JsonResponse([])
|
||||
|
||||
|
Reference in New Issue
Block a user