Hello All,
I'm trying to write a decorator in my views file but when the decorated function is returned django complains that the view does not have an HttpResponseObject. How do I return a decorated view without running the rest of the view code. Or should I just be using a function.
enter code here
def special_check(f):
def wrap(request):
# If not some requirement
# raise SomeException
return wrap
@special_check
my_view(request):
# Do the rest of my view work.
Cheers
T