From abb80784e4feb75dc8f1991eb4cadcb312e60a6e Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Fri, 15 Jan 2016 11:58:53 +0700 Subject: [PATCH] Verify domain name input --- app/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views.py b/app/views.py index c0f5ac6..a0462df 100644 --- a/app/views.py +++ b/app/views.py @@ -159,6 +159,10 @@ def domain_add(): try: domain_name = request.form.getlist('domain_name')[0] domain_type = request.form.getlist('radio_type')[0] + + if ' ' in domain_name or not domain_name or not domain_type: + return render_template('400.html', msg="Please correct your input"), 400 + if domain_type == 'slave': if request.form.getlist('domain_master_address'): domain_master_string = request.form.getlist('domain_master_address')[0]