Skip to content

Commit

Permalink
Notifications: use instance.slug instead of instance.name (#11018)
Browse files Browse the repository at this point in the history
We need to `escape()` some of the values that are controlled by the user before
being able to format them.

Related #11016
  • Loading branch information
humitos authored Jan 10, 2024
1 parent ac125ee commit 4a864c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions readthedocs/oauth/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
body=_(
textwrap.dedent(
"""
Could not add webhook for {instance.name}.
Could not add webhook for "{instance.slug}".
Please <a href="{url_connect_account}">connect your {provider_name} account</a>.
"""
).strip(),
Expand All @@ -36,7 +36,7 @@
body=_(
textwrap.dedent(
"""
Could not add webhook for {instance.name}.
Could not add webhook for "{instance.slug}".
Make sure <a href="{url_docs_webhook}">you have the correct {provider_name} permissions</a>.
"""
).strip(),
Expand All @@ -49,7 +49,7 @@
body=_(
textwrap.dedent(
"""
The project {instance.name} doesn't have a valid webhook set up,
The project "{instance.slug}" doesn't have a valid webhook set up,
commits won't trigger new builds for this project.
See <a href='{url_integrations}'>the project integrations</a> for more information.
"""
Expand All @@ -63,7 +63,7 @@
body=_(
textwrap.dedent(
"""
Could not send {provider_name} build status report for {instance.name}.
Could not send {provider_name} build status report for "{instance.slug}".
Make sure you have the correct {provider_name} repository permissions</a> and
your <a href="{url_connect_account}">{provider_name} account</a>
is connected to Read the Docs.
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/subscriptions/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def for_organizations(cls):
body=_(
textwrap.dedent(
"""
The organization "{instance.name}" is currently disabled. You need to <a href="{subscription_url}">renew your subscription</a> to keep using Read the Docs
The organization "{instance.slug}" is currently disabled. You need to <a href="{subscription_url}">renew your subscription</a> to keep using Read the Docs
"""
).strip(),
),
Expand Down

0 comments on commit 4a864c3

Please sign in to comment.