-
Notifications
You must be signed in to change notification settings - Fork 355
[ENG-7707] A specific preprint is not found but should be #11059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-7707] A specific preprint is not found but should be #11059
Conversation
| 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 |
There was a problem hiding this comment.
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.
brianjgeiger
left a comment
There was a problem hiding this 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.
0ba47a9
into
CenterForOpenScience:feature/pbs-25-05
…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
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 ...
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 workflowQA 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