Allow extra kwargs to core View.redirect() method

This commit is contained in:
Lance Edgar 2016-06-14 22:19:16 -05:00
parent 686ae1b657
commit d94372ee41

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2015 Lance Edgar # Copyright © 2010-2016 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -24,7 +24,7 @@
Base View Class Base View Class
""" """
from __future__ import unicode_literals from __future__ import unicode_literals, absolute_import
from rattail.db import model from rattail.db import model
@ -58,11 +58,11 @@ class View(object):
if uuid: if uuid:
return Session.query(model.User).get(uuid) return Session.query(model.User).get(uuid)
def redirect(self, url): def redirect(self, url, **kwargs):
""" """
Convenience method to return a HTTP 302 response. Convenience method to return a HTTP 302 response.
""" """
return httpexceptions.HTTPFound(location=url) return httpexceptions.HTTPFound(location=url, **kwargs)
def fake_error(request): def fake_error(request):