Skip to content

Conversation

@antkryt
Copy link
Contributor

@antkryt antkryt commented Mar 26, 2025

Purpose

Show preprints in public states

Changes

It's possible that Review Action was not created for published preprint (see Preprint.set_published() function for more details). This change will consider public states for different workflows instead of only filtering by review actions for pre-moderation workflow

QA Notes

The easiest way to recreate this bug I was able to found is to create preprint via website, but not submitting it. Instead, go to the admin panel of the preprint and hit "Make published" button. It'll make preprint published with machine state 'accepted', but won't create review action for it. Such preprint will be visible only for provider moderators if provider review workflow is not None. I think there may be some other ways to recreate it (suspect any PATCH /v2/preprints/<preprint_id> request with published=True)

All of that sould be fixed with this PR

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-7707

Comment on lines 657 to 662
res = self.app.get(f'/{API_BASE}preprints/{self.pre_mod_preprint._id.split('_')[0]}/', auth=self.moderator.auth, expect_errors=True)
assert res.status_code == 200

# preprint version
res = self.app.get(f'/{API_BASE}preprints/{pre_mod_preprint_v2._id}/', auth=self.moderator.auth, expect_errors=True)
assert res.status_code == 200
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're getting a status of 200 back, you shouldn't be expecting_errors.

Copy link
Collaborator

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update your tests not to expect errors when you aren't expecting errors.

@brianjgeiger brianjgeiger merged commit 0ba47a9 into CenterForOpenScience:feature/pbs-25-05 Mar 28, 2025
6 checks passed
Johnetordoff added a commit to Johnetordoff/osf.io that referenced this pull request Mar 31, 2025
…cience/osf.io into fix-preprint-dois

* 'feature/pbs-25-05' of https://github.com/CenterForOpenScience/osf.io:
  [ENG-7707] A specific preprint is not found but should be (CenterForOpenScience#11059)
  [ENG-7461] Fix Validation Issues with Article DOIs (CenterForOpenScience#11062)
  [ENG-6422] added management command to log all write actions to given table (CenterForOpenScience#11057)
  add CSRF protection and throttle classes; update tests
  refactor external login serializer and view to use session data for user information
  add external login unit tests
  removed campaigns
  fix tests
  Add external login serializer and view for first-time OAuth users

# Conflicts:
#	api/preprints/serializers.py
#	api_tests/preprints/views/test_preprint_detail.py
Johnetordoff added a commit to Johnetordoff/osf.io that referenced this pull request Apr 11, 2025
 into develop

* 'develop' of https://github.com/CenterForOpenScience/osf.io: (61 commits)
  Update changelog and package.json
  [ENG-7698] Fix permission for contributor, when accepting access request #2 (CenterForOpenScience#11077)
  Add disable meetings feature
  Fix institutional access request for contributor
  upgrade cache and ubuntu versions to avoid GHA brownouts (CenterForOpenScience#11009)
  [ENG-7461] Fix bug with Article DOI for Preprints (CenterForOpenScience#11068)
  [ENG-7472] Fix/preprint no option to resubmit (CenterForOpenScience#11069)
  [ENG-7714] Use retry instead of sleep (CenterForOpenScience#11067)
  Implement flag to disable comment updates and add corresponding tests
  [ENG-7707] A specific preprint is not found but should be (CenterForOpenScience#11059)
  Add feature flag to disable comments and update related tests
  [ENG-7461] Fix Validation Issues with Article DOIs (CenterForOpenScience#11062)
  [ENG-6422] added management command to log all write actions to given table (CenterForOpenScience#11057)
  add CSRF protection and throttle classes; update tests
  refactor external login serializer and view to use session data for user information
  add external login unit tests
  removed campaigns
  fix tests
  Add external login serializer and view for first-time OAuth users
  Fix permission for contributor, when accept access request
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants