From 8c5e1b95b3d6e5913ed2be5401d8ae6f984c1521 Mon Sep 17 00:00:00 2001 From: Alen Mujezinovic Date: Wed, 6 Jul 2011 18:11:05 +0100 Subject: [PATCH] Fixes template names being cut off when using sync_templates: http://cl.ly/0R092W1H3n3m19120j1x --- dbtemplates/management/commands/sync_templates.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbtemplates/management/commands/sync_templates.py b/dbtemplates/management/commands/sync_templates.py index 7c62134..92f412b 100644 --- a/dbtemplates/management/commands/sync_templates.py +++ b/dbtemplates/management/commands/sync_templates.py @@ -60,7 +60,9 @@ class Command(NoArgsCommand): for f in [f for f in filenames if f.endswith(extension) and not f.startswith(".")]: path = os.path.join(dirpath, f) - name = path.split(templatedir)[1][1:] + name = path.split(templatedir)[1] + if name.startswith('/'): + name = name[1:] try: t = Template.on_site.get(name__exact=name) except Template.DoesNotExist: