stroopwafel eindpunt

This commit is contained in:
2024-07-26 13:19:33 +02:00
parent f4294d8bf9
commit ae9b3bf5c5
2 changed files with 15 additions and 2 deletions
+14 -2
View File
@@ -1,6 +1,6 @@
from django.shortcuts import render
from django.views import View
from django.http import HttpResponse, HttpResponseRedirect
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.template.response import TemplateResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Avg
@@ -287,4 +287,16 @@ class PlaylistImportView(LoginRequiredMixin, View):
except Exception as e:
print(e)
return self.get(request)
return self.get(request)
class StroopwafelView(View):
def get(self, request):
nominated_count = Track.objects.all().count()
return JsonResponse(
{
"openDate": os.getenv('DATE_OPEN'),
"deadlineNominations": os.getenv('DATE_NOM_END'),
"deadlineVoting": os.getenv('DATE_VOTE_END'),
"stemCount": nominated_count
}
)