some polishing

This commit is contained in:
ville rantanen
2018-11-11 11:43:18 +02:00
parent 9908e5795b
commit 3fc20ee43a
4 changed files with 24 additions and 7 deletions

View File

@@ -22,6 +22,8 @@ CODEFINDER = re.compile(r'\`([^\`]+)\`')
app = Flask(__name__)
app.config.from_object(__name__)
app.config['SESSION_COOKIE_NAME'] = os.getenv('SESSION_COOKIE_NAME', 'mdshop')
app.config['register'] = os.getenv('ENABLE_REGISTER', 'true') != 'false'
print(app.config)
app.wsgi_app = ReverseProxied(app.wsgi_app)
def connect_db():
@@ -463,6 +465,8 @@ def login():
@app.route('/register', methods=['GET', 'POST'])
def register():
error = None
if not app.config['register']:
return ""
if request.method == 'POST':
import re, string
pattern = re.compile('[\W]+')