Fix a bug in tag deletion and category deletion. Avoid double slash on image URL

This commit is contained in:
Grégory Soutadé 2013-01-27 09:44:17 +01:00
parent 3d393c907c
commit 8d02850017
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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 = ''