mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-26 18:48:42 +02:00
fix(security): toasts and month_year_picker accessible without login
This commit is contained in:
@@ -4,14 +4,22 @@ from django.db.models.functions import ExtractYear, ExtractMonth
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.views.decorators.http import require_http_methods
|
||||||
|
|
||||||
|
from apps.common.decorators.htmx import only_htmx
|
||||||
from apps.transactions.models import Transaction
|
from apps.transactions.models import Transaction
|
||||||
|
|
||||||
|
|
||||||
|
@only_htmx
|
||||||
|
@login_required
|
||||||
|
@require_http_methods(["GET"])
|
||||||
def toasts(request):
|
def toasts(request):
|
||||||
return render(request, "common/fragments/toasts.html")
|
return render(request, "common/fragments/toasts.html")
|
||||||
|
|
||||||
|
|
||||||
|
@only_htmx
|
||||||
|
@login_required
|
||||||
|
@require_http_methods(["GET"])
|
||||||
def month_year_picker(request):
|
def month_year_picker(request):
|
||||||
field = request.GET.get("field", "reference_date")
|
field = request.GET.get("field", "reference_date")
|
||||||
for_ = request.GET.get("for", None)
|
for_ = request.GET.get("for", None)
|
||||||
|
|||||||
Reference in New Issue
Block a user