File tree 2 files changed +3
-5
lines changed 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
from django .contrib .auth import logout
6
6
from django .shortcuts import redirect
7
- from django .utils .http import url_has_allowed_host_and_scheme , urlencode
7
+ from django .utils .http import url_has_allowed_host_and_scheme
8
8
from django .views import View
9
9
10
10
from main import settings
@@ -80,8 +80,7 @@ def get(
80
80
not profile .completed_onboarding
81
81
and request .GET .get ("skip_onboarding" , "0" ) == "0"
82
82
):
83
- params = urlencode ({"next" : redirect_url })
84
- redirect_url = f"{ settings .MITOL_NEW_USER_LOGIN_URL } ?{ params } "
83
+ redirect_url = settings .MITOL_NEW_USER_LOGIN_URL
85
84
profile .completed_onboarding = True
86
85
profile .save ()
87
86
return redirect (redirect_url )
Original file line number Diff line number Diff line change @@ -120,15 +120,14 @@ def test_custom_login_view_authenticated_user_with_onboarding(mocker):
120
120
request .user = MagicMock (is_anonymous = False )
121
121
request .user .profile = MagicMock (completed_onboarding = False )
122
122
mocker .patch ("authentication.views.get_redirect_url" , return_value = "/dashboard" )
123
- mocker .patch ("authentication.views.urlencode" , return_value = "next=/dashboard" )
124
123
mocker .patch (
125
124
"authentication.views.settings.MITOL_NEW_USER_LOGIN_URL" , "/onboarding"
126
125
)
127
126
128
127
response = CustomLoginView ().get (request )
129
128
130
129
assert response .status_code == 302
131
- assert response .url == "/onboarding?next=/dashboard "
130
+ assert response .url == "/onboarding"
132
131
133
132
134
133
def test_custom_login_view_authenticated_user_skip_onboarding (mocker ):
You can’t perform that action at this time.
0 commit comments