Skip to content

Commit 0d4d9c5

Browse files
committed
Merge branch 'feature/pbs-25-07' of https://github.com/CenterForOpenScience/osf.io into impact-notifications
* 'feature/pbs-25-07' of https://github.com/CenterForOpenScience/osf.io: [ENG-7289] Fix Search Index Discrepancy in Collection Facets (#11085)
2 parents 3f356a4 + c43cc32 commit 0d4d9c5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

api_tests/collections/test_views.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from osf.utils.permissions import ADMIN, WRITE, READ
2222
from website.project.signals import contributor_removed
2323
from api_tests.utils import disconnected_from_listeners
24+
from api_tests.share._utils import mock_update_share
2425
from website.views import find_bookmark_collection
2526

2627

@@ -4340,6 +4341,18 @@ def test_with_permissions(self, app, collection_with_three_collection_submission
43404341
assert len(res.json['data']) == 0
43414342
assert res.status_code == 200
43424343

4344+
def test_update_share_called(self, app, collection_with_zero_collection_submission, user_one, project_four, url, payload, subject_one):
4345+
collection_with_zero_collection_submission.is_public = True
4346+
collection_with_zero_collection_submission.save()
4347+
4348+
with mock_update_share() as _shmock:
4349+
res = app.post_json_api(
4350+
url.format(collection_with_zero_collection_submission._id),
4351+
payload(guid=project_four._id, subjects=[[subject_one._id]]),
4352+
auth=user_one.auth)
4353+
assert res.status_code == 201
4354+
_shmock.assert_called()
4355+
43434356
def test_filters(self, app, collection_with_one_collection_submission, collection_with_three_collection_submission, project_two, project_four, user_one, subject_one, url, payload):
43444357
res = app.get(f'{url.format(collection_with_three_collection_submission._id)}?filter[id]={project_two._id}', auth=user_one.auth)
43454358
assert res.status_code == 200

osf/management/commands/sync_collection_provider_indices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def sync_collection_provider_indices(cp_ids=None, only_remove=False):
2626
submission.remove_from_index()
2727
remove_ct += 1
2828
elif not only_remove:
29-
submission.update_index()
29+
submission.update_search()
3030
add_ct += 1
3131
logger.info(f'{remove_ct} submissions removed from {prov._id}')
3232
logger.info(f'{add_ct} submissions synced to {prov._id}')

0 commit comments

Comments
 (0)