import: Fix propagation of subdomain error messages.

The previous logic would provide a very confusing error message if the
subdomain was already in use.
This commit is contained in:
Tim Abbott 2021-06-09 12:55:50 -07:00
parent 1fa82c2fcd
commit d041bb0674
1 changed files with 5 additions and 2 deletions

View File

@ -77,8 +77,11 @@ import a database dump from one or more JSON files."""
try: try:
check_subdomain_available(subdomain, allow_reserved_subdomain) check_subdomain_available(subdomain, allow_reserved_subdomain)
except ValidationError: except ValidationError as e:
raise CommandError("Subdomain reserved: pass --allow-reserved-subdomain to use.") raise CommandError(
e.messages[0]
+ "\nPass --allow-reserved-subdomain to override subdomain restrictions."
)
paths = [] paths = []
for path in options["export_paths"]: for path in options["export_paths"]: