Skip to content

Hide Banned Projects from the Site #6231

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

Closed
wants to merge 5 commits into from

Conversation

saadmk11
Copy link
Member

@saadmk11 saadmk11 commented Oct 1, 2019

closes #5152

Can View Banned Projects: Project User, Admin User
Can not View Banned Projects: Anonymous User, Regular User

@saadmk11 saadmk11 added the PR: work in progress Pull request is not ready for full review label Oct 1, 2019
@saadmk11 saadmk11 requested a review from a team October 2, 2019 14:15
@saadmk11 saadmk11 removed the PR: work in progress Pull request is not ready for full review label Oct 2, 2019
@saadmk11 saadmk11 force-pushed the hide-banned-projects branch from 0bda0fb to b51135d Compare October 2, 2019 18:52
@saadmk11
Copy link
Member Author

saadmk11 commented Oct 3, 2019

It seems like if the project has no user or the project users have no profile then the project will not be visible by Anonymous User, Regular User. That's why tests are failing as many tests don't meet those requirements. @readthedocs/core Is this (not showing these kinds of projects) something we want?

@humitos
Copy link
Member

humitos commented Oct 9, 2019

Hrm, this is a good question.

The goal of this PR is to hide projects from banned users. The only way to know the user is banned is from their profile. IMO, if the user does not have profile or the project does not have users, it should be returned in the queryset. Otherwise, we will be excluding projects that we are not 100% sure they are banned.

@saadmk11
Copy link
Member Author

saadmk11 commented Oct 9, 2019

@humitos Sounds good to me. I have updated the PR with a bit different approach so that we don't filter out those cases. Please have a look :)

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

I'm -1 on this change. It will make our queries much slower. We already removed this logic from the homepage view because it caused downtime from being slow, and this change seems like it will just make all of our Project queries much slower.

We should just delete these projects, not make our queries way more complex.

Sorry for the confusion here, but I didn't quite realize how slow these queries were, but we definitely shouldn't be introducing them on all Project queries.

@saadmk11
Copy link
Member Author

I'm -1 on this change. It will make our queries much slower. We already removed this logic from the homepage view because it caused downtime from being slow, and this change seems like it will just make all of our Project queries much slower.

We should just delete these projects, not make our queries way more complex.

Sorry for the confusion here, but I didn't quite realize how slow these queries were, but we definitely shouldn't be introducing them on all Project queries.

Where do you suggest adding these filters? Or should we just stick with deleting banned projects and do the queries as before?

@stale
Copy link

stale bot commented Dec 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Dec 12, 2019
@stsewd
Copy link
Member

stsewd commented Dec 16, 2019

So, we already have a semi-automatic way of deleting spam projects, so I guess we don't need to filter spam projects anymore (we hit an issue when we tried something like this, the queries are very slow)

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Dec 16, 2019
@ericholscher
Copy link
Member

Sorry for not replying here -- I think we should just skip this logic, and delete projects that are banned. We have now automated the deletion, so once they're banned they should be deleted. I think we can close this.

@saadmk11 saadmk11 deleted the hide-banned-projects branch December 16, 2019 16:42
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.

Hide banned projects from the site
4 participants