From 76d3c448fe7e5d3350690bb989476a921f156b23 Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Mon, 14 Feb 2011 14:13:05 -0500 Subject: [PATCH] Corrected Waldo AccountMultiView typo and improved View error reporting / TargetURL error catching. --- contrib/waldo/models.py | 2 +- models/nodes.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/waldo/models.py b/contrib/waldo/models.py index 3286aa0..d35e22a 100644 --- a/contrib/waldo/models.py +++ b/contrib/waldo/models.py @@ -416,7 +416,7 @@ class AccountMultiView(LoginMultiView): user.email = email user.save() messages.add_message(request, messages.SUCCESS, 'Email changed successfully.') - return HttpReponseRedirect(self.reverse('account', node=request.node)) + return HttpResponseRedirect(self.reverse('account', node=request.node)) raise Http404 diff --git a/models/nodes.py b/models/nodes.py index 10c51b4..07a5e0a 100644 --- a/models/nodes.py +++ b/models/nodes.py @@ -114,8 +114,8 @@ class View(Entity): try: subpath = reverse(view_name, urlconf=self, args=args or [], kwargs=kwargs or {}) - except NoReverseMatch: - raise ViewCanNotProvideSubpath + except NoReverseMatch, e: + raise ViewCanNotProvideSubpath(e.message) if node is not None: return node.construct_url(subpath) @@ -219,7 +219,7 @@ class TargetURLModel(models.Model): try: self.get_target_url() - except NoReverseMatch, e: + except (NoReverseMatch, ViewCanNotProvideSubpath), e: raise ValidationError(e.message) super(TargetURLModel, self).clean() -- 2.20.1