saml_idp: Rewrite to CBV

This commit is contained in:
Jens Langhammer
2018-12-16 17:09:26 +01:00
parent 7a62bf9829
commit 764282ea9e
4 changed files with 150 additions and 133 deletions

12
passbook/lib/mixins.py Normal file
View File

@ -0,0 +1,12 @@
"""passbook util mixins"""
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
class CSRFExemptMixin:
"""wrapper to apply @csrf_exempt to CBV"""
@method_decorator(csrf_exempt)
def dispatch(self, *args, **kwargs):
"""wrapper to apply @csrf_exempt to CBV"""
return super().dispatch(*args, **kwargs)