Skip to content

Commit

Permalink
revert commit 45d7615 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostap-Zherebetskyi authored and cslzchen committed Jan 10, 2025
1 parent 35d70c8 commit 4182a15
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/collections/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def collection_preprints(self, collection, user, latest_only=False):
user=user,
)
if latest_only:
preprints = preprints.filter(pk__in=[obj.pk for obj in preprints if obj.is_latest_version])
preprints = preprints.filter(guids__isnull=False)
return preprints

def get_collection_submission(self, check_object_permissions=True):
Expand Down
2 changes: 1 addition & 1 deletion api_tests/nodes/views/test_node_preprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_unpublished_visible_to_admins(
preprint_unpublished,
preprint_published, url):
res = app.get(url, auth=user_admin_contrib.auth)
assert len(res.json['data']) == 1
assert len(res.json['data']) == 2
assert preprint_published._id in [d['id'] for d in res.json['data']]

def test_unpublished_invisible_to_write_contribs(
Expand Down
3 changes: 2 additions & 1 deletion api_tests/preprints/views/test_preprint_list_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def test_filter_published_false_admin(
res = app.get(
f'{url}filter[is_published]=false',
auth=user_admin_contrib.auth)
assert len(res.json['data']) == 0
assert len(res.json['data']) == 1
assert preprint_unpublished._id in [d['id'] for d in res.json['data']]


@pytest.mark.django_db
Expand Down

0 comments on commit 4182a15

Please sign in to comment.