From 45b15a8fb327d18078b29f9517bdd08aec366a7b Mon Sep 17 00:00:00 2001 From: Richard Barrell Date: Tue, 8 Nov 2011 16:41:57 -0800 Subject: Raise a ValueError from HTTPFound.__init__() if location is None. --- pyramid/httpexceptions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index 4dbca7021..bd745df87 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -434,6 +434,8 @@ ${html_comment}''') def __init__(self, location='', detail=None, headers=None, comment=None, body_template=None, **kw): + if location is None: + raise ValueError("HTTP redirects need a location to redirect to.") super(_HTTPMove, self).__init__( detail=detail, headers=headers, comment=comment, body_template=body_template, location=location, **kw) -- cgit v1.2.3