GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit ead782ad authored by ViolanteCodes's avatar ViolanteCodes
Browse files

working json dict api request

parent 8aa3f4de
from rest_framework.decorators import api_view
from rest_framework.response import Response
from anonticket.models import Issue, Note, GitlabAccountRequest
#Function based view iwth Api-view decorator
@api_view()
def list_irc_pending(request):
"""View to list Pending API totals. GET-only accepted."""
return Response({"message": "Hello, world!"})
issue_total = Issue.objects.filter(reviewer_status='P').count()
note_total = Note.objects.filter(reviewer_status='P').count()
gitlab_account_request_total = GitlabAccountRequest.objects.filter(reviewer_status='P').count()
build_dictionary = {
"Pending Issues": issue_total,
"Pending Notes": note_total,
"Pending Gitlab Account Requests": gitlab_account_request_total,
}
return Response(build_dictionary)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment