Fix a bug in tag deletion and category deletion. Avoid double slash on image URL
This commit is contained in:
parent
3d393c907c
commit
8d02850017
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user