Only validate email if it was provided

This commit is contained in:
Tim Van Baak 2020-01-29 01:03:59 -08:00
parent 1b1332a42d
commit 02e7065b21

View File

@ -96,7 +96,7 @@ def create_user(username, displayname, email):
# Validate arguments
if not valid_username(username):
raise ValueError("Invalid username: '{}'".format(username))
if not valid_email(email):
if email and not valid_email(email):
raise ValueError("Invalid email: '{}'".format(email))
# Create the user directory and initialize it with a blank user