-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
0bda0fb
to
b51135d
Compare
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? |
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. |
@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 :) |
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.
LGTM!
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.
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? |
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. |
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) |
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. |
closes #5152
Can View Banned Projects: Project User, Admin User
Can not View Banned Projects: Anonymous User, Regular User