mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Don’t show styleguide on live environment
Its audience is people working on the product, not the end users.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from flask import render_template
|
from flask import render_template, current_app, abort
|
||||||
from flask_wtf import Form
|
from flask_wtf import Form
|
||||||
from wtforms import StringField, PasswordField, TextAreaField, FileField, validators
|
from wtforms import StringField, PasswordField, TextAreaField, FileField, validators
|
||||||
from app.main import main
|
from app.main import main
|
||||||
@@ -7,6 +7,9 @@ from app.main import main
|
|||||||
@main.route('/_styleguide')
|
@main.route('/_styleguide')
|
||||||
def styleguide():
|
def styleguide():
|
||||||
|
|
||||||
|
if not current_app.config['SHOW_STYLEGUIDE']:
|
||||||
|
abort(404)
|
||||||
|
|
||||||
class FormExamples(Form):
|
class FormExamples(Form):
|
||||||
username = StringField(u'Username')
|
username = StringField(u'Username')
|
||||||
password = PasswordField(u'Password', [validators.required()])
|
password = PasswordField(u'Password', [validators.required()])
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ class Config(object):
|
|||||||
|
|
||||||
AWS_REGION = 'eu-west-1'
|
AWS_REGION = 'eu-west-1'
|
||||||
|
|
||||||
|
SHOW_STYLEGUIDE = True
|
||||||
|
|
||||||
|
|
||||||
class Development(Config):
|
class Development(Config):
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
@@ -66,7 +68,7 @@ class Preview(Config):
|
|||||||
|
|
||||||
|
|
||||||
class Staging(Preview):
|
class Staging(Preview):
|
||||||
pass
|
SHOW_STYLEGUIDE = False
|
||||||
|
|
||||||
|
|
||||||
class Live(Staging):
|
class Live(Staging):
|
||||||
|
|||||||
Reference in New Issue
Block a user