From 8d02850017c6d235a71a910148bfc621ddafc602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 27 Jan 2013 09:44:17 +0100 Subject: [PATCH] Fix a bug in tag deletion and category deletion. Avoid double slash on image URL --- models.py | 4 ++-- views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models.py b/models.py index b262af8..78e4f6a 100644 --- a/models.py +++ b/models.py @@ -180,7 +180,7 @@ class Category(models.Model): super(Category, self).save() def remove(self): - blog = Blog.objects.get(pk=self.blog) + blog = Blog.objects.get(pk=self.blog.id) output = blog.output_path + '/category/' + self.name_slug if os.path.exists(output): shutil.rmtree(output) @@ -196,7 +196,7 @@ class Tag(models.Model): super(Tag, self).save() def remove(self): - blog = Blog.objects.get(pk=self.blog) + blog = Blog.objects.get(pk=self.blog.id) output = blog.output_path + '/tag/' + self.name_slug if os.path.exists(output): shutil.rmtree(output) diff --git a/views.py b/views.py index 3ffcf7f..4112602 100644 --- a/views.py +++ b/views.py @@ -588,7 +588,7 @@ def _tinymcelist(request, b, year, month): suffix = '/images/' + str(year) + '/' + str(month) path = b.src_path + '/' + suffix - url = 'http://' + b.name + '/' + suffix + '/' + url = 'http://' + b.name + suffix + '/' if os.path.exists(path): files = ''