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

Cleanup use of is_usergroup_member('/usergroup/super-librarians') #9266

Closed
RayBB opened this issue May 13, 2024 · 4 comments · Fixed by #9275
Closed

Cleanup use of is_usergroup_member('/usergroup/super-librarians') #9266

RayBB opened this issue May 13, 2024 · 4 comments · Fixed by #9275
Assignees
Labels
Good First Issue Easy issue. Good for newcomers. [managed] Lead: @RayBB Issues overseen by Ray (Onboarding & Documentation Lead) [manages] Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed]

Comments

@RayBB
Copy link
Collaborator

RayBB commented May 13, 2024

Problem

Refactor all instance of self.is_usergroup_member('/usergroup/super-librarians') to use is_super_librarian()

This will be very similar to https://github.com/internetarchive/openlibrary/pull/9123/files

This is a followup to #9087

Evidence / Screenshot

image

Reproducing the bug

No response

Context

No response

Notes from this Issue's Lead

Proposal & constraints

Related files

Stakeholders

@RayBB RayBB added Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed] Lead: @RayBB Issues overseen by Ray (Onboarding & Documentation Lead) [manages] Good First Issue Easy issue. Good for newcomers. [managed] labels May 13, 2024
@SivanC
Copy link
Contributor

SivanC commented May 15, 2024

@RayBB Hi, happy to make these changes!

@RayBB
Copy link
Collaborator Author

RayBB commented May 15, 2024

@SivanC you're assigned. Good luck! If you run into things other than "super-librarians" that might need to be refactored please make a note of it and we can probably do it in a separate PR.

@SivanC
Copy link
Contributor

SivanC commented May 15, 2024

Will do, thanks!

@SivanC
Copy link
Contributor

SivanC commented May 15, 2024

@RayBB Four things I noticed:

  • Based on your screenshot there may be one use I can't find? 22 results across 18 files for you vs. 21 results across 17 files for me
  • Vast majority of uses of is_super_librarian() are in conjunction with is_admin(), including a couple that make their own local is_privileged_user() or similar method, maybe that should added?
  • There is still a use of is_usergroup_member('/usergroup/librarians') in /templates/type/authors/view.html line 43
  • The ia usergroup doesn't have an is_ia() method, but it's only used once so probably intentional

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label May 16, 2024
@RayBB RayBB added Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. and removed Needs: Response Issues which require feedback from lead labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Easy issue. Good for newcomers. [managed] Lead: @RayBB Issues overseen by Ray (Onboarding & Documentation Lead) [manages] Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants