From 950124e640913e150088d8644506aceaadd7ef49 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 16 Nov 2012 11:05:08 +0100 Subject: [PATCH] webob.HTTPFound --> MG.tools.redirect Transition away from webob. Signed-off-by: Sebastian Spaeth --- mediagoblin/auth/views.py | 4 +--- mediagoblin/edit/views.py | 9 ++++----- mediagoblin/user_pages/views.py | 8 +++----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 31f50fa6..b95ea18d 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -17,8 +17,6 @@ import uuid import datetime -from webob import exc - from mediagoblin import messages from mediagoblin import mg_globals from mediagoblin.tools.response import render_to_response, redirect, render_404 @@ -129,7 +127,7 @@ def login(request): request.session.save() if request.form.get('next'): - return exc.HTTPFound(location=request.form['next']) + return redirect(request, location=request.form['next']) else: return redirect(request, "index") diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 3be1e87b..8840f36f 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -14,7 +14,6 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from webob import exc from cgi import FieldStorage from datetime import datetime @@ -76,8 +75,8 @@ def edit_media(request, media): media.save() - return exc.HTTPFound( - location=media.url_for_self(request.urlgen)) + return redirect(request, + location=media.url_for_self(request.urlgen)) if request.user.is_admin \ and media.uploader != request.user.id \ @@ -158,8 +157,8 @@ def edit_attachments(request, media): % (request.form['attachment_name'] or request.files['attachment_file'].filename)) - return exc.HTTPFound( - location=media.url_for_self(request.urlgen)) + return redirect(request, + location=media.url_for_self(request.urlgen)) return render_to_response( request, 'mediagoblin/edit/attachments.html', diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index a091f13b..fe4f5dbc 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -14,7 +14,6 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from webob import exc import logging import datetime @@ -167,8 +166,7 @@ def media_post_comment(request, media): media_uploader.wants_comment_notification): send_comment_email(media_uploader, comment, media, request) - return exc.HTTPFound( - location=media.url_for_self(request.urlgen)) + return redirect(request, location=media.url_for_self(request.urlgen)) @get_user_media_entry @@ -302,8 +300,8 @@ def media_confirm_delete(request, media): messages.add_message( request, messages.ERROR, _("The media was not deleted because you didn't check that you were sure.")) - return exc.HTTPFound( - location=media.url_for_self(request.urlgen)) + return redirect(request, + location=media.url_for_self(request.urlgen)) if ((request.user.is_admin and request.user.id != media.uploader)): -- 2.25.1