aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-08-19 14:33:07 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-08-19 14:33:07 -0700
commitbd0b5daa44691c8cf72ef2ff5a8cdc3b01490722 (patch)
tree5bb34fcd88d2f04b002097944533f67c5cd5bddb
parente7b8059f17c98ee88d933af52b0c4d858e882e8e (diff)
downloadmediagoblin-bd0b5daa44691c8cf72ef2ff5a8cdc3b01490722.tar.lz
mediagoblin-bd0b5daa44691c8cf72ef2ff5a8cdc3b01490722.tar.xz
mediagoblin-bd0b5daa44691c8cf72ef2ff5a8cdc3b01490722.zip
-skip persona test is requests is not installed
- should use request.urlgen for location
-rw-r--r--mediagoblin/tests/test_persona.py2
-rw-r--r--mediagoblin/user_pages/views.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_persona.py b/mediagoblin/tests/test_persona.py
index ce795258..919877c9 100644
--- a/mediagoblin/tests/test_persona.py
+++ b/mediagoblin/tests/test_persona.py
@@ -18,6 +18,8 @@ import pkg_resources
import pytest
import mock
+pytest.importorskip("requests")
+
from mediagoblin import mg_globals
from mediagoblin.db.base import Session
from mediagoblin.tests.tools import get_app
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 9d3cb08b..49691a29 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -305,8 +305,9 @@ def media_confirm_delete(request, media):
if not location:
location=media.url_to_prev(request.urlgen)
if not location:
- location="mediagoblin.user_pages.user_home"
- return redirect(request, location=location, user=username)
+ location=request.urlgen("mediagoblin.user_pages.user_home",
+ user=username)
+ return redirect(request, location=location)
else:
messages.add_message(
request, messages.ERROR,