import_template: don't error out in case of missing template (#31958)

This commit is contained in:
Frédéric Péters 2019-04-03 09:40:38 +02:00
parent 2f9e3eab75
commit c4c0c24ad8
1 changed files with 4 additions and 4 deletions

View File

@ -32,9 +32,9 @@ class Command(BaseCommand):
basepath = kwargs.get('basepath', '/var/lib/%s/skeletons')
template = '%s/%s.json' % (basepath, kwargs.get('template_name'))
if not os.path.exists(template):
self.stderr.write(self.style.WARNING('Unknown template (%r)' % template))
return
if 'import_site' in get_commands():
if not os.path.isfile(template):
raise(CommandError('Template not found'))
call_command('import_site', template)