webob.HTTPFound --> MG.tools.redirect
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 16 Nov 2012 10:05:08 +0000 (11:05 +0100)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 21 Dec 2012 07:11:40 +0000 (08:11 +0100)
Transition away from webob.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
mediagoblin/auth/views.py
mediagoblin/edit/views.py
mediagoblin/user_pages/views.py

index 31f50fa660fa1c265cec69b1633cca070f2ae310..b95ea18d18603e91976c4c3a21fdfe79d3c5356d 100644 (file)
@@ -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")
 
index 3be1e87baf0729b84febb59ed363aa174b0ec634..8840f36f0547b817b71cc4c1f81b8ed84a68c681 100644 (file)
@@ -14,7 +14,6 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-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',
index a091f13b56ebe7895ee57a55d48a04eee412e4b2..fe4f5dbc39015d5aaf6052fbb8276d29a9c7dfa4 100644 (file)
@@ -14,7 +14,6 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-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)):