fix: Check if site exists before new-site

This commit is contained in:
Faris Ansari 2019-07-20 20:33:50 +05:30
parent abf54a0866
commit 9cafae9d53

View file

@ -40,6 +40,10 @@ def _new_site(db_name, site, mariadb_root_username=None, mariadb_root_password=N
reinstall=False, db_type=None):
"""Install a new Frappe site"""
if os.path.exists(site):
print('Site {0} already exists'.format(site))
sys.exit(1)
if not db_name:
db_name = '_' + hashlib.sha1(site.encode()).hexdigest()[:16]