import_template: don't error out in case of missing template (#31958)
This commit is contained in:
parent
2f9e3eab75
commit
c4c0c24ad8
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue