mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-01-19 07:16:57 +01:00
15 lines
314 B
Python
15 lines
314 B
Python
from functools import wraps
|
|
|
|
from django.core.exceptions import PermissionDenied
|
|
|
|
|
|
def only_htmx(view):
|
|
@wraps(view)
|
|
def _view(request, *args, **kwargs):
|
|
if not request.META.get("HTTP_HX_REQUEST"):
|
|
raise PermissionDenied
|
|
|
|
return view(request, *args, **kwargs)
|
|
|
|
return _view
|