mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-22 08:38:35 +02:00
changes
This commit is contained in:
0
app/apps/common/decorators/__init__.py
Normal file
0
app/apps/common/decorators/__init__.py
Normal file
14
app/apps/common/decorators/htmx.py
Normal file
14
app/apps/common/decorators/htmx.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
Reference in New Issue
Block a user