import: Fix ordering of subdomain availability check.

When you're importing with --destroy-rebuild-database, we need to
check subdomain availability after we've cleared out the database;
otherwise, trying to reuse the same subdomain doesn't work.
This commit is contained in:
Tim Abbott
2018-04-20 10:38:33 -07:00
parent e96af7906d
commit 97ccdacb18

View File

@@ -65,7 +65,6 @@ import a database dump from one or more JSON files."""
if subdomain is None:
print("Enter subdomain!")
exit(1)
check_subdomain_available(subdomain)
if options["destroy_rebuild_database"]:
print("Rebuilding the database!")
@@ -75,6 +74,8 @@ import a database dump from one or more JSON files."""
for model in models_to_import:
self.new_instance_check(model)
check_subdomain_available(subdomain)
for path in options['export_files']:
if not os.path.exists(path):
print("Directory not found: '%s'" % (path,))