Projet

Général

Profil

0001-import_template-don-t-error-out-in-case-of-missing-t.patch

Frédéric Péters, 03 avril 2019 09:41

Télécharger (1,25 ko)

Voir les différences:

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

 hobo/agent/common/management/commands/import_template.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hobo/agent/common/management/commands/import_template.py
32 32
        basepath = kwargs.get('basepath', '/var/lib/%s/skeletons')
33 33
        template = '%s/%s.json' % (basepath, kwargs.get('template_name'))
34 34

  
35
        if 'import_site' in get_commands():
36

  
37
            if not os.path.isfile(template):
38
                raise(CommandError('Template not found'))
35
        if not os.path.exists(template):
36
            self.stderr.write(self.style.WARNING('Unknown template (%r)' % template))
37
            return
39 38

  
39
        if 'import_site' in get_commands():
40 40
            call_command('import_site', template)
41
-