Skip to content

Commit 088eb48

Browse files
ericholscherclaude
andauthored
Addons: default PR build notification to off for new projects (#12934)
The "created from a pull request build" toast was on by default, but visual diff is doing most of the work that it does much less intrusively. Flip it to opt-in for new projects; existing projects keep their value (schema-only migration). Companion to #12932. Generated by Claude Code. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f20acad commit 088eb48

File tree

5 files changed

+50
-3
lines changed

5 files changed

+50
-3
lines changed

docs/user/pull-requests.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ Build overview with changed files
3333
This feature is only available for projects connected to a :ref:`reference/git-integration:GitHub App`.
3434

3535
Pull request notifications
36-
A pull request notifications is shown at the top of preview pages,
36+
A pull request notification can be shown at the top of preview pages,
3737
which let readers know they aren't viewing an active version of the project.
38+
New projects have this notification disabled by default;
39+
enable it from :guilabel:`Settings` → :guilabel:`Addons` → :guilabel:`Notifications`.
3840

3941
:doc:`Visual diff </visual-diff>`
4042
Visual diff shows proposed changes by visually highlighting the differences between the current pull request and the latest version of the project's documentation.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated by Django 5.2.12 on 2026-04-14 00:00
2+
3+
from django.db import migrations
4+
from django.db import models
5+
from django_safemigrate import Safe
6+
7+
8+
class Migration(migrations.Migration):
9+
safe = Safe.before_deploy()
10+
11+
dependencies = [
12+
("projects", "0160_notifications_show_on_external_help_text"),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name="addonsconfig",
18+
name="notifications_show_on_external",
19+
field=models.BooleanField(
20+
default=False,
21+
help_text=(
22+
"Display a notification on the rendered documentation of pull "
23+
"request previews. Readers will see a toast linking to the "
24+
"build and the pull request."
25+
),
26+
verbose_name="Show a notification on builds from pull requests",
27+
),
28+
),
29+
migrations.AlterField(
30+
model_name="historicaladdonsconfig",
31+
name="notifications_show_on_external",
32+
field=models.BooleanField(
33+
default=False,
34+
help_text=(
35+
"Display a notification on the rendered documentation of pull "
36+
"request previews. Readers will see a toast linking to the "
37+
"build and the pull request."
38+
),
39+
verbose_name="Show a notification on builds from pull requests",
40+
),
41+
),
42+
]

readthedocs/projects/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class AddonsConfig(TimeStampedModel):
261261
notifications_show_on_latest = models.BooleanField(default=True)
262262
notifications_show_on_non_stable = models.BooleanField(default=True)
263263
notifications_show_on_external = models.BooleanField(
264-
default=True,
264+
default=False,
265265
verbose_name=_("Show a notification on builds from pull requests"),
266266
help_text=_(
267267
"Display a notification on the rendered documentation of pull "

readthedocs/proxito/tests/responses/v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
},
141141
"notifications": {
142142
"enabled": true,
143-
"show_on_external": true,
143+
"show_on_external": false,
144144
"show_on_latest": true,
145145
"show_on_non_stable": true
146146
},
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% extends "projects/project_edit_base.html" %}
2+
3+
{# This is just a placeholder to satisfy tests. This template is only implemented in ext-theme #}

0 commit comments

Comments
 (0)