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

Permissions: avoid using project.users, use proper permissions instead #8458

Merged
merged 1 commit into from Sep 7, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Sep 2, 2021

One step further to fully depreate the signals in .com
that add owners to a project.

One step further to fully depreate the signals in .com
that add owners to a project.
@stsewd stsewd requested a review from a team September 2, 2021 22:48
@@ -376,7 +376,7 @@ def send_build_status(build_pk, commit, status, link_to_build=False):
if provider_name in [GITHUB_BRAND, GITLAB_BRAND]:
# get the service class for the project e.g: GitHubService.
service_class = build.project.git_service_class()
users = build.project.users.all()
Copy link
Member

Choose a reason for hiding this comment

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

Can we have validation in the linter that detects the usage of projects.users. and complains?

Copy link
Member Author

Choose a reason for hiding this comment

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

that would be great. I don't know if there is a tool that does this.

@@ -23,5 +23,5 @@ def sort_version_aware(versions):

@register.filter
def is_project_user(user, project):
Copy link
Member

Choose a reason for hiding this comment

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

It may make sense to rename this filter to is_project_member.

@stsewd stsewd merged commit 7b7bcbc into master Sep 7, 2021
@stsewd stsewd deleted the use-proper-querysets branch September 7, 2021 12:46
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.

None yet

2 participants