Skip to content

Commit 0c0586e

Browse files
mkovaluaantkryt
authored andcommitted
[ENG-10405] change /myprojects to /my-projects to work good with angular (CenterForOpenScience#11624)
1 parent e13bad2 commit 0c0586e

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

framework/auth/views.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _reset_password_get(auth, uid=None, token=None, institutional=False):
8383
}
8484
raise HTTPError(http_status.HTTP_400_BAD_REQUEST, data=error_data)
8585

86-
# override routes.py login_url to redirect to myprojects
86+
# override routes.py login_url to redirect to my-projects
8787
service_url = web_url_for('my_projects', _absolute=True)
8888

8989
return {
@@ -174,7 +174,7 @@ def forgot_password_get(auth):
174174
if auth.logged_in:
175175
return auth_logout(redirect_url=request.url)
176176

177-
#overriding the routes.py sign in url to redirect to the myprojects after login
177+
#overriding the routes.py sign in url to redirect to the my-projects after login
178178
context = {}
179179
context['login_url'] = web_url_for('my_projects', _absolute=True)
180180

@@ -408,7 +408,7 @@ def auth_login(auth):
408408
if campaign and logged out, go to campaign register page (with next_url if presents)
409409
if next_url and logged in, go to next url
410410
if next_url and logged out, go to cas login page with current request url as service parameter
411-
if none, go to `/myprojects` which is decorated by `@must_be_logged_in`
411+
if none, go to `/my-projects` which is decorated by `@must_be_logged_in`
412412
413413
:param auth: the auth context
414414
:return: redirects
@@ -435,7 +435,7 @@ def auth_register(auth):
435435
if next_url and logged in, go to next url
436436
if next_url and logged out, go to cas login page with current request url as service parameter
437437
if next_url and logout flag, log user out first and then go to the next_url
438-
if none, go to `/myprojects` which is decorated by `@must_be_logged_in`
438+
if none, go to `/my-projects` which is decorated by `@must_be_logged_in`
439439
440440
:param auth: the auth context
441441
:return: land, redirect or `auth_logout`
@@ -995,7 +995,7 @@ def resend_confirmation_post(auth):
995995
try:
996996
send_confirm_email(user, clean_email, renew=True)
997997
except KeyError:
998-
# already confirmed, redirect to myprojects
998+
# already confirmed, redirect to my-projects
999999
status_message = f'This email {clean_email} has already been confirmed.'
10001000
kind = 'warning'
10011001
user.email_last_sent = timezone.now()

tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_confirm_email(self):
9696
res = self.app.resolve_redirect(res)
9797

9898
assert res.status_code == 302
99-
assert '/myprojects/' == urlparse(res.location).path
99+
assert '/my-projects/' == urlparse(res.location).path
100100
# assert len(get_session()['status']) == 1
101101

102102
def test_get_user_by_id(self):

tests/test_project_contributor_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def test_private_project_remove_self_not_admin(self):
453453
)
454454
self.project.reload()
455455
assert res.status_code == 200
456-
assert res.json['redirectUrl'] == '/myprojects/'
456+
assert res.json['redirectUrl'] == '/my-projects/'
457457
assert self.user2._id not in self.project.contributors
458458

459459
def test_public_project_remove_self_not_admin(self):

tests/test_webtests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_can_see_profile_url(self):
7979
res = self.app.get(self.user.url, follow_redirects=True)
8080
assert self.user.url in res.text
8181

82-
# `GET /login/` without parameters is redirected to `/myprojects/` page which has `@must_be_logged_in` decorator
82+
# `GET /login/` without parameters is redirected to `/my-projects/` page which has `@must_be_logged_in` decorator
8383
# if user is not logged in, she/he is further redirected to CAS login page
8484
def test_is_redirected_to_cas_if_not_logged_in_at_login_page(self):
8585
res = self.app.resolve_redirect(self.app.get('/login/'))
@@ -90,7 +90,7 @@ def test_is_redirected_to_cas_if_not_logged_in_at_login_page(self):
9090
def test_is_redirected_to_myprojects_if_already_logged_in_at_login_page(self):
9191
res = self.app.get('/login/', auth=self.user.auth)
9292
assert res.status_code == 302
93-
assert 'myprojects' in res.headers.get('Location')
93+
assert 'my-projects' in res.headers.get('Location')
9494

9595
def test_register_page(self):
9696
res = self.app.get('/register/')
@@ -99,7 +99,7 @@ def test_register_page(self):
9999
def test_is_redirected_to_myprojects_if_already_logged_in_at_register_page(self):
100100
res = self.app.get('/register/', auth=self.user.auth)
101101
assert res.status_code == 302
102-
assert 'myprojects' in res.headers.get('Location')
102+
assert 'my-projects' in res.headers.get('Location')
103103

104104
def test_sees_projects_in_her_dashboard(self):
105105
# the user already has a project

website/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ def paginate(items, total, page, size):
165165

166166

167167
def index():
168-
return redirect('/myprojects/')
168+
return redirect('/my-projects/')
169169

170170

171171
def dashboard():
172-
return redirect('/myprojects/')
172+
return redirect('/my-projects/')
173173

174174

175175
def reproducibility():

0 commit comments

Comments
 (0)