Skip to content

Commit b014761

Browse files
authored
Merge pull request #8779 from readthedocs/humitos/project-is-spam
Spam: allow to mark a project as (non)spam manually
2 parents f8e325d + dc92ce2 commit b014761

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

readthedocs/projects/admin.py

+1
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class ProjectAdmin(ExtraSimpleHistoryAdmin):
225225

226226
list_filter = list_filter + (
227227
ProjectOwnerBannedFilter,
228+
'is_spam',
228229
'feature__feature_id',
229230
'repo_type',
230231
'privacy_level',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 2.2.25 on 2021-12-21 09:35
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('projects', '0085_subscribe_old_webhooks_to_events'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='historicalproject',
15+
name='is_spam',
16+
field=models.NullBooleanField(default=None, help_text='Manually marked as (not) spam', verbose_name='Is spam?'),
17+
),
18+
migrations.AddField(
19+
model_name='project',
20+
name='is_spam',
21+
field=models.NullBooleanField(default=None, help_text='Manually marked as (not) spam', verbose_name='Is spam?'),
22+
),
23+
]

readthedocs/projects/models.py

+5
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ class Project(models.Model):
306306
default=False,
307307
help_text='If checked, do not show advertising for this project',
308308
)
309+
is_spam = models.NullBooleanField(
310+
_('Is spam?'),
311+
default=None,
312+
help_text=_('Manually marked as (not) spam'),
313+
)
309314
show_version_warning = models.BooleanField(
310315
_('Show version warning'),
311316
default=False,

readthedocs/settings/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -893,3 +893,4 @@ def DOCKER_LIMITS(self):
893893
RTD_SPAM_THRESHOLD_DONT_SHOW_DASHBOARD = 300
894894
RTD_SPAM_THRESHOLD_DONT_SERVE_DOCS = 500
895895
RTD_SPAM_THRESHOLD_DELETE_PROJECT = 1000
896+
RTD_SPAM_MAX_SCORE = 9999

0 commit comments

Comments
 (0)