Skip to content

Commit 8eef3fa

Browse files
authored
[ANG-1044] Change sitemap url for nodes and registrations to append overview (#11355)
* change sitemap url for nodes and registrations to append overview * fix tests
1 parent 85c58a0 commit 8eef3fa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

osf_tests/test_generate_sitemap.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ def all_included_links(self, user_admin_project_public, user_admin_project_priva
133133
urls_to_include.extend([
134134
user_admin_project_public.url,
135135
user_admin_project_private.url,
136-
project_registration_public.url,
137-
project_preprint_osf.url,
138-
project_preprint_other.url,
139-
registration_active.url,
136+
project_registration_public.url + 'overview',
137+
project_preprint_osf.url + 'overview',
138+
project_preprint_other.url + 'overview',
139+
registration_active.url + 'overview',
140140
f'/preprints/{provider_osf._id}/{preprint_osf._id}',
141141
f'/preprints/{provider_osf._id}/{preprint_osf_version._id}',
142142
f'/preprints/{provider_other._id}/{preprint_other._id}',
@@ -182,18 +182,18 @@ def test_private_project_link_not_included(self, project_private, create_tmp_dir
182182
with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory):
183183
urls = get_all_sitemap_urls()
184184

185-
assert urljoin(settings.DOMAIN, project_private.url) not in urls
185+
assert urljoin(settings.DOMAIN, project_private.url + 'overview') not in urls
186186

187187
def test_embargoed_registration_link_not_included(self, registration_embargoed, create_tmp_directory):
188188

189189
with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory):
190190
urls = get_all_sitemap_urls()
191191

192-
assert urljoin(settings.DOMAIN, registration_embargoed.url) not in urls
192+
assert urljoin(settings.DOMAIN, registration_embargoed.url + 'overview') not in urls
193193

194194
def test_deleted_project_link_not_included(self, project_deleted, create_tmp_directory):
195195

196196
with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory):
197197
urls = get_all_sitemap_urls()
198198

199-
assert urljoin(settings.DOMAIN, project_deleted.url) not in urls
199+
assert urljoin(settings.DOMAIN, project_deleted.url + 'overview') not in urls

scripts/generate_sitemap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def generate(self):
191191
for obj in objs:
192192
try:
193193
config = settings.SITEMAP_NODE_CONFIG
194-
config['loc'] = urljoin(settings.DOMAIN, '/{}/'.format(obj['guids___id']))
194+
config['loc'] = urljoin(settings.DOMAIN, '/{}/overview'.format(obj['guids___id']))
195195
config['lastmod'] = obj['modified'].strftime('%Y-%m-%d')
196196
self.add_url(config)
197197
except Exception as e:

0 commit comments

Comments
 (0)