[collector] ensure endpoint only accepts POST requests
This commit is contained in:
parent
4605dedc69
commit
aa5d19c5e5
2 changed files with 22 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ from django.db.models import QuerySet
|
|||
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
|
||||
from django.urls import reverse
|
||||
from django.views import generic
|
||||
from django.views.decorators.http import require_http_methods
|
||||
|
||||
from .models import Teil
|
||||
|
||||
|
|
@ -44,6 +45,7 @@ class DetailView(generic.DetailView):
|
|||
return context
|
||||
|
||||
|
||||
@require_http_methods(["POST"])
|
||||
def enter(request: HttpRequest) -> HttpResponse:
|
||||
try:
|
||||
with transaction.atomic():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue