summaryrefslogtreecommitdiffstats
path: root/stator/views.py
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-19 10:20:13 -0700
committerAndrew Godwin2022-11-19 10:20:13 -0700
commit2142677b015507bc1aeb6179c5dfc4dfa3aaf0ce (patch)
treedaac448f073c16a3e48157f2897ee6eff2a4d4d7 /stator/views.py
parent80193114909a3f6ca1eda9a47b6330ef249a8ee5 (diff)
downloadtakahe-2142677b015507bc1aeb6179c5dfc4dfa3aaf0ce.tar.gz
takahe-2142677b015507bc1aeb6179c5dfc4dfa3aaf0ce.tar.bz2
takahe-2142677b015507bc1aeb6179c5dfc4dfa3aaf0ce.zip
A few more tweaks for an initial deploy
Diffstat (limited to 'stator/views.py')
-rw-r--r--stator/views.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/stator/views.py b/stator/views.py
deleted file mode 100644
index 9d2e154..0000000
--- a/stator/views.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from django.conf import settings
-from django.http import HttpResponse, HttpResponseForbidden
-from django.views import View
-
-from stator.models import StatorModel
-from stator.runner import StatorRunner
-
-
-class RequestRunner(View):
- """
- Runs a Stator runner within a HTTP request. For when you're on something
- serverless.
- """
-
- async def get(self, request):
- # Check the token, if supplied
- if settings.STATOR_TOKEN:
- if request.GET.get("token") != settings.STATOR_TOKEN:
- return HttpResponseForbidden()
- # Run on all models
- runner = StatorRunner(StatorModel.subclasses)
- handled = await runner.run()
- return HttpResponse(f"Handled {handled}")