diff --git a/framework/auth/views.py b/framework/auth/views.py index c8a41b795f6..3b5a4f20dea 100644 --- a/framework/auth/views.py +++ b/framework/auth/views.py @@ -83,7 +83,7 @@ def _reset_password_get(auth, uid=None, token=None, institutional=False): } raise HTTPError(http_status.HTTP_400_BAD_REQUEST, data=error_data) - # override routes.py login_url to redirect to myprojects + # override routes.py login_url to redirect to my-projects service_url = web_url_for('my_projects', _absolute=True) return { @@ -174,7 +174,7 @@ def forgot_password_get(auth): if auth.logged_in: return auth_logout(redirect_url=request.url) - #overriding the routes.py sign in url to redirect to the myprojects after login + #overriding the routes.py sign in url to redirect to the my-projects after login context = {} context['login_url'] = web_url_for('my_projects', _absolute=True) @@ -410,7 +410,7 @@ def auth_login(auth): if campaign and logged out, go to campaign register page (with next_url if presents) if next_url and logged in, go to next url if next_url and logged out, go to cas login page with current request url as service parameter - if none, go to `/myprojects` which is decorated by `@must_be_logged_in` + if none, go to `/my-projects` which is decorated by `@must_be_logged_in` :param auth: the auth context :return: redirects @@ -437,7 +437,7 @@ def auth_register(auth): if next_url and logged in, go to next url if next_url and logged out, go to cas login page with current request url as service parameter if next_url and logout flag, log user out first and then go to the next_url - if none, go to `/myprojects` which is decorated by `@must_be_logged_in` + if none, go to `/my-projects` which is decorated by `@must_be_logged_in` :param auth: the auth context :return: land, redirect or `auth_logout` @@ -999,7 +999,7 @@ def resend_confirmation_post(auth): try: send_confirm_email(user, clean_email, renew=True) except KeyError: - # already confirmed, redirect to myprojects + # already confirmed, redirect to my-projects status_message = f'This email {clean_email} has already been confirmed.' kind = 'warning' user.email_last_sent = timezone.now() diff --git a/osf/management/commands/metrics_backfill_pageviews.py b/osf/management/commands/metrics_backfill_pageviews.py index 4a3cc729d0d..13898037923 100644 --- a/osf/management/commands/metrics_backfill_pageviews.py +++ b/osf/management/commands/metrics_backfill_pageviews.py @@ -27,12 +27,12 @@ def main(source, dry_run=False, resume_from=None): # page.info.protocol + page.info.domain => _source.platform_iri # "http://localhost:5000/", # visitor.session => _source.session_id # "fcae918a3b6a19641bd0087f84083f0d57982d8c93ab821c405561d1b5c7b305", # user.id => _source.user_is_authenticated # true, - # page.url => _source.pageview_info.page_url # "http://localhost:5000/myprojects/", + # page.url => _source.pageview_info.page_url # "http://localhost:5000/my-projects/", # page.title => _source.pageview_info.page_title # "OSF | My Projects", # referrer.url => _source.pageview_info.referer_url # "http://localhost:5000/csab4/analytics", # page.meta.routeName => _source.pageview_info.route_name # "OsfWebRenderer.my_projects", # time.utc.hour_of_day => _source.pageview_info.hour_of_day # 4, - # page.info.path => _source.pageview_info.page_path # "/myprojects", + # page.info.path => _source.pageview_info.page_path # "/my-projects", # referrer.info.domain => _source.pageview_info.referer_domain # "localhost:5000" # page.meta.public => _source.item_public # true, # node.id => _source.item_guid # "ry7dn", @@ -85,7 +85,7 @@ def populate_action_labels(something_wonderful, row): if row['page.info.path']: path_parts = row['page.info.path'].split('/') - if len(path_parts) == 1 and path_parts[0] not in ('myprojects', 'goodbye', 'login'): + if len(path_parts) == 1 and path_parts[0] not in ('my-projects', 'goodbye', 'login'): labels.append('view') elif path_parts[1] in ('wiki'): labels.append('view') diff --git a/tests/test_auth.py b/tests/test_auth.py index ad5fa602a22..63f0684699f 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -96,7 +96,7 @@ def test_confirm_email(self): res = self.app.resolve_redirect(res) assert res.status_code == 302 - assert '/myprojects/' == urlparse(res.location).path + assert '/my-projects/' == urlparse(res.location).path # assert len(get_session()['status']) == 1 def test_get_user_by_id(self): diff --git a/tests/test_project_contributor_views.py b/tests/test_project_contributor_views.py index 7fa97ca5aac..c03cf9365b3 100644 --- a/tests/test_project_contributor_views.py +++ b/tests/test_project_contributor_views.py @@ -453,7 +453,7 @@ def test_private_project_remove_self_not_admin(self): ) self.project.reload() assert res.status_code == 200 - assert res.json['redirectUrl'] == '/myprojects/' + assert res.json['redirectUrl'] == '/my-projects/' assert self.user2._id not in self.project.contributors def test_public_project_remove_self_not_admin(self): diff --git a/tests/test_webtests.py b/tests/test_webtests.py index 66f5995d208..cd840105fe7 100644 --- a/tests/test_webtests.py +++ b/tests/test_webtests.py @@ -79,7 +79,7 @@ def test_can_see_profile_url(self): res = self.app.get(self.user.url, follow_redirects=True) assert self.user.url in res.text - # `GET /login/` without parameters is redirected to `/myprojects/` page which has `@must_be_logged_in` decorator + # `GET /login/` without parameters is redirected to `/my-projects/` page which has `@must_be_logged_in` decorator # if user is not logged in, she/he is further redirected to CAS login page def test_is_redirected_to_cas_if_not_logged_in_at_login_page(self): 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): def test_is_redirected_to_myprojects_if_already_logged_in_at_login_page(self): res = self.app.get('/login/', auth=self.user.auth) assert res.status_code == 302 - assert 'myprojects' in res.headers.get('Location') + assert 'my-projects' in res.headers.get('Location') def test_register_page(self): res = self.app.get('/register/') @@ -99,14 +99,14 @@ def test_register_page(self): def test_is_redirected_to_myprojects_if_already_logged_in_at_register_page(self): res = self.app.get('/register/', auth=self.user.auth) assert res.status_code == 302 - assert 'myprojects' in res.headers.get('Location') + assert 'my-projects' in res.headers.get('Location') def test_sees_projects_in_her_dashboard(self): # the user already has a project project = ProjectFactory(creator=self.user) project.add_contributor(self.user) project.save() - res = self.app.get('/myprojects/', auth=self.user.auth) + res = self.app.get('/my-projects/', auth=self.user.auth) assert 'Projects' in res.text # Projects heading def test_does_not_see_osffiles_in_user_addon_settings(self): @@ -124,7 +124,7 @@ def test_sees_osffiles_in_project_addon_settings(self): def test_sees_correct_title_on_dashboard(self): # User goes to dashboard - res = self.app.get('/myprojects/', auth=self.auth, follow_redirects=True) + res = self.app.get('/my-projects/', auth=self.auth, follow_redirects=True) title = res.html.title.string assert 'OSF | My Projects' == title diff --git a/website/routes.py b/website/routes.py index e5af9991281..df2984562bf 100644 --- a/website/routes.py +++ b/website/routes.py @@ -309,7 +309,7 @@ def make_url_map(app): notemplate ), Rule( - '/myprojects/', + '/my-projects/', 'get', website_views.my_projects, OsfWebRenderer('my_projects.mako', trust=False) diff --git a/website/static/js/myProjects.js b/website/static/js/myProjects.js index 830df968276..148f71d5865 100644 --- a/website/static/js/myProjects.js +++ b/website/static/js/myProjects.js @@ -574,7 +574,7 @@ var MyProjects = { */ self.setFilterHistory = function(index) { // if not on the myprojects version of this page, don't change state (e.g., institutions) - if (window.location.href.indexOf('/myprojects') === -1 ) { + if (window.location.href.indexOf('/my-projects') === -1 ) { return; } var filter; @@ -585,7 +585,7 @@ var MyProjects = { } // Uses replaceState instead of pushState because back buttons will not reset the filter on back without forcing a page refresh // A bug in history causes titles not to change despite setting them here. - window.history.replaceState({setFilter: index}, 'OSF | ' + filter.title, '/myprojects/' + filter.name); + window.history.replaceState({setFilter: index}, 'OSF | ' + filter.title, '/my-projects/' + filter.name); }; /** @@ -593,7 +593,7 @@ var MyProjects = { */ self.getFilterIndex = function() { // if not on the myprojects version of this page, don't change state (e.g., institutions) - if (window.location.href.indexOf('/myprojects') === -1 ) { + if (window.location.href.indexOf('/my-projects') === -1 ) { return 0; } // Cast to string undefined => "undefined" to handle upper/lower case anchors diff --git a/website/templates/collection_submission_cancel.html.mako b/website/templates/collection_submission_cancel.html.mako index 6ee11c1af7c..007d1846da9 100644 --- a/website/templates/collection_submission_cancel.html.mako +++ b/website/templates/collection_submission_cancel.html.mako @@ -10,7 +10,7 @@ % if collection_provider: ${collection_provider_name} % else: - ${collection_provider_name} + ${collection_provider_name} % endif was canceled. If you wish to be associated with the collection, you will need to request to be added again. @@ -20,7 +20,7 @@ % if collection_provider: ${collection_provider_name} % else: - ${collection_provider_name} + ${collection_provider_name} % endif If you wish to be associated with the collection, an admin will need to request addition again. % endif diff --git a/website/templates/collection_submission_removed_private.html.mako b/website/templates/collection_submission_removed_private.html.mako index 726de7f2077..6d97ce0fedb 100644 --- a/website/templates/collection_submission_removed_private.html.mako +++ b/website/templates/collection_submission_removed_private.html.mako @@ -11,7 +11,7 @@ % if collection_provider: ${collection_provider_name} % else: - ${collection_provider_name} + ${collection_provider_name} % endif . If you wish to be associated with the collection, you will need to request addition to the collection again. % else: @@ -20,7 +20,7 @@ % if collection_provider: ${collection_provider_name} % else: - ${collection_provider_name} + ${collection_provider_name} % endif It will need to be re-submitted to be included in the collection again. % endif diff --git a/website/views.py b/website/views.py index 2d8784618d3..db89d258959 100644 --- a/website/views.py +++ b/website/views.py @@ -165,11 +165,11 @@ def paginate(items, total, page, size): def index(): - return redirect('/myprojects/') + return redirect('/my-projects/') def dashboard(): - return redirect('/myprojects/') + return redirect('/my-projects/') def reproducibility():