Skip to content
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

Fixes #2612 - Moved text messages for certain routes to config #2649

Merged
merged 1 commit into from
Oct 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions config/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,31 @@

# Messages Configuration

CSS_FIX_ME = """
This resource doesn't exist anymore.
See https://github.com/webcompat/css-fixme/
for more details."""

IS_BLACKLISTED_DOMAIN = (u'Anonymous reporting for domain {0} '
'is temporarily disabled. Please contact '
'[email protected] '
'for more details.')

SHOW_RATE_LIMIT = """
All those moments will be lost in time…
like tears in rain…
Time to die.
– Blade Runner

This resource doesn't exist anymore."""

WELL_KNOWN_ALL = """
Sorry dear bot,
the route /.well-known/{subpath} doesn't exist.

Nothing behind me, everything ahead of me, as is ever so on the road.
- Jack Kerouac, On the Road."""

WELL_KNOWN_SECURITY = """Contact: mailto:[email protected]
Contact: mailto:[email protected]
"""
18 changes: 3 additions & 15 deletions webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ def create_issue():
url=form['url'].encode('utf-8')))
# Checking blacklisted domains
if is_blacklisted_domain(form['url']):
msg = (u'Anonymous reporting for domain {0} '
'is temporarily disabled. Please contact '
'[email protected] '
'for more details.').format(form['url'])
msg = app.config['IS_BLACKLISTED_DOMAIN'].format(form['url'])
flash(msg, 'notimeout')
return redirect(url_for('index'))
# Check if the form is valid
Expand Down Expand Up @@ -311,13 +308,7 @@ def show_rate_limit():
Decision made on March 2017. See
https://github.com/webcompat/webcompat.com/issues/1437
"""
msg = """
All those moments will be lost in time…
like tears in rain…
Time to die.
– Blade Runner

This resource doesn't exist anymore."""
msg = app.config['SHOW_RATE_LIMIT']
return (msg, 410, {'content-type': 'text/plain; charset=utf-8'})


Expand Down Expand Up @@ -444,10 +435,7 @@ def cssfixme():

Previously home of a CSS fixing tool.
"""
msg = """
This resource doesn't exist anymore.
See https://github.com/webcompat/css-fixme/
for more details."""
msg = app.config['CSS_FIX_ME']
return (msg, 410, {'content-type': 'text/plain; charset=utf-8'})


Expand Down