Skip to content
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

Refactor checking super librarian status with is_usergroup_member() #9275

Conversation

SivanC
Copy link
Contributor

@SivanC SivanC commented May 15, 2024

Closes #9266

Refactors uses of self.is_usergroup_member('/usergroup/super-librarians') to is_super_librarian()

Technical

Simple find and replace (except the definition of course)

Testing

Screenshot

Stakeholders

@RayBB

@SivanC
Copy link
Contributor Author

SivanC commented May 15, 2024

Adding books seems to be failing looking into it:
FAILED openlibrary/plugins/upstream/tests/test_addbook.py::TestSaveBookHelper::test_editing_orphan_creates_work - AttributeError: 'MockUser' object has no attribute 'is_super_librarian'

Edit: Fixed by adding missing line to test_addbook.py

Copy link
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

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

Thanks for the work!
Tested locally and seems to work as expected.
However, given this touches many important files would like a second check from staff.

PS for the reviewer: We did a very similar task recently in #9123

@RayBB RayBB added the Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. label May 20, 2024
@mekarpeles mekarpeles self-assigned this May 20, 2024
@mekarpeles mekarpeles added the Priority: 1 Do this week, receiving emails, time sensitive, . [managed] label May 20, 2024
@mekarpeles
Copy link
Member

lgtm

@mekarpeles mekarpeles merged commit 88f5223 into internetarchive:master May 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. Priority: 1 Do this week, receiving emails, time sensitive, . [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup use of is_usergroup_member('/usergroup/super-librarians')
3 participants