From a823789ab2fdec0d9eb634b82c9d4f1bfa3556ea Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 1 Apr 2019 16:02:01 +1300 Subject: [PATCH] dockersetup: require email address Do not allow proceeding until an email address has been entered, because we need it later on for creating the superuser account. Signed-off-by: Paul Eggleton --- dockersetup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dockersetup.py b/dockersetup.py index 5a899c1..41f77d5 100755 --- a/dockersetup.py +++ b/dockersetup.py @@ -507,7 +507,13 @@ if not updatemode: print('You will now be asked for an email address. This will be used for the superuser account, to send error reports to and for Let\'s Encrypt.') else: print('You will now be asked for an email address. This will be used for the superuser account and to send error reports to.') - emailaddr = input('Enter your email address: ') + emailaddr = None + while True: + emailaddr = input('Enter your email address: ') + if '@' in emailaddr: + break + else: + print('Entered email address is not valid') if reinstmode: return_code = subprocess.call("docker-compose down -v", shell=True)