Add forbidden() convenience method to core View class

This commit is contained in:
Lance Edgar 2019-10-02 18:11:26 -05:00
parent 59d3a18b3f
commit c8e689712a

View file

@ -72,6 +72,12 @@ class View(object):
"""
return getattr(self.request, 'rattail_config', None)
def forbidden(self):
"""
Convenience method, to raise a HTTP 403 Forbidden exception.
"""
return httpexceptions.HTTPForbidden()
def notfound(self):
return httpexceptions.HTTPNotFound()