Skip to content

Commit 3a8bf09

Browse files
committed
Notifications: use instance.slug instead of instance.name
We need to `escape()` some of the values that are controlled by the user before being able to format them. Related #11016
1 parent 12ef6f2 commit 3a8bf09

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

readthedocs/oauth/notifications.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
body=_(
2424
textwrap.dedent(
2525
"""
26-
Could not add webhook for {instance.name}.
26+
Could not add webhook for "{instance.slug}".
2727
Please <a href="{url_connect_account}">connect your {provider_name} account</a>.
2828
"""
2929
).strip(),
@@ -36,7 +36,7 @@
3636
body=_(
3737
textwrap.dedent(
3838
"""
39-
Could not add webhook for {instance.name}.
39+
Could not add webhook for "{instance.slug}".
4040
Make sure <a href="{url_docs_webhook}">you have the correct {provider_name} permissions</a>.
4141
"""
4242
).strip(),
@@ -49,7 +49,7 @@
4949
body=_(
5050
textwrap.dedent(
5151
"""
52-
The project {instance.name} doesn't have a valid webhook set up,
52+
The project "{instance.slug}" doesn't have a valid webhook set up,
5353
commits won't trigger new builds for this project.
5454
See <a href='{url_integrations}'>the project integrations</a> for more information.
5555
"""
@@ -63,7 +63,7 @@
6363
body=_(
6464
textwrap.dedent(
6565
"""
66-
Could not send {provider_name} build status report for {instance.name}.
66+
Could not send {provider_name} build status report for "{instance.slug}".
6767
Make sure you have the correct {provider_name} repository permissions</a> and
6868
your <a href="{url_connect_account}">{provider_name} account</a>
6969
is connected to Read the Docs.

readthedocs/subscriptions/notifications.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def for_organizations(cls):
9393
body=_(
9494
textwrap.dedent(
9595
"""
96-
The organization "{instance.name}" is currently disabled. You need to <a href="{subscription_url}">renew your subscription</a> to keep using Read the Docs
96+
The organization "{instance.slug}" is currently disabled. You need to <a href="{subscription_url}">renew your subscription</a> to keep using Read the Docs
9797
"""
9898
).strip(),
9999
),

0 commit comments

Comments
 (0)