webob.HTTPFound --> MG.tools.redirect
Transition away from webob. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
62d14bf50b
commit
950124e640
@ -17,8 +17,6 @@
|
|||||||
import uuid
|
import uuid
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from webob import exc
|
|
||||||
|
|
||||||
from mediagoblin import messages
|
from mediagoblin import messages
|
||||||
from mediagoblin import mg_globals
|
from mediagoblin import mg_globals
|
||||||
from mediagoblin.tools.response import render_to_response, redirect, render_404
|
from mediagoblin.tools.response import render_to_response, redirect, render_404
|
||||||
@ -129,7 +127,7 @@ def login(request):
|
|||||||
request.session.save()
|
request.session.save()
|
||||||
|
|
||||||
if request.form.get('next'):
|
if request.form.get('next'):
|
||||||
return exc.HTTPFound(location=request.form['next'])
|
return redirect(request, location=request.form['next'])
|
||||||
else:
|
else:
|
||||||
return redirect(request, "index")
|
return redirect(request, "index")
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from webob import exc
|
|
||||||
from cgi import FieldStorage
|
from cgi import FieldStorage
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -76,8 +75,8 @@ def edit_media(request, media):
|
|||||||
|
|
||||||
media.save()
|
media.save()
|
||||||
|
|
||||||
return exc.HTTPFound(
|
return redirect(request,
|
||||||
location=media.url_for_self(request.urlgen))
|
location=media.url_for_self(request.urlgen))
|
||||||
|
|
||||||
if request.user.is_admin \
|
if request.user.is_admin \
|
||||||
and media.uploader != request.user.id \
|
and media.uploader != request.user.id \
|
||||||
@ -158,8 +157,8 @@ def edit_attachments(request, media):
|
|||||||
% (request.form['attachment_name']
|
% (request.form['attachment_name']
|
||||||
or request.files['attachment_file'].filename))
|
or request.files['attachment_file'].filename))
|
||||||
|
|
||||||
return exc.HTTPFound(
|
return redirect(request,
|
||||||
location=media.url_for_self(request.urlgen))
|
location=media.url_for_self(request.urlgen))
|
||||||
return render_to_response(
|
return render_to_response(
|
||||||
request,
|
request,
|
||||||
'mediagoblin/edit/attachments.html',
|
'mediagoblin/edit/attachments.html',
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from webob import exc
|
|
||||||
import logging
|
import logging
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
@ -167,8 +166,7 @@ def media_post_comment(request, media):
|
|||||||
media_uploader.wants_comment_notification):
|
media_uploader.wants_comment_notification):
|
||||||
send_comment_email(media_uploader, comment, media, request)
|
send_comment_email(media_uploader, comment, media, request)
|
||||||
|
|
||||||
return exc.HTTPFound(
|
return redirect(request, location=media.url_for_self(request.urlgen))
|
||||||
location=media.url_for_self(request.urlgen))
|
|
||||||
|
|
||||||
|
|
||||||
@get_user_media_entry
|
@get_user_media_entry
|
||||||
@ -302,8 +300,8 @@ def media_confirm_delete(request, media):
|
|||||||
messages.add_message(
|
messages.add_message(
|
||||||
request, messages.ERROR,
|
request, messages.ERROR,
|
||||||
_("The media was not deleted because you didn't check that you were sure."))
|
_("The media was not deleted because you didn't check that you were sure."))
|
||||||
return exc.HTTPFound(
|
return redirect(request,
|
||||||
location=media.url_for_self(request.urlgen))
|
location=media.url_for_self(request.urlgen))
|
||||||
|
|
||||||
if ((request.user.is_admin and
|
if ((request.user.is_admin and
|
||||||
request.user.id != media.uploader)):
|
request.user.id != media.uploader)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user