Use Python!
This commit is contained in:
parent
104515d59e
commit
e247a4bd50
1 changed files with 1 additions and 1 deletions
|
@ -287,7 +287,7 @@ class Post(models.Model):
|
|||
super(Post, self).save(*args, **kwargs)
|
||||
|
||||
def move_to(self, to_topic, delete_topic=True):
|
||||
delete_topic = (self.topic.posts.count() == 1 && delete_topic)
|
||||
delete_topic = (self.topic.posts.count() == 1) and delete_topic
|
||||
prev_topic = self.topic
|
||||
self.topic = to_topic
|
||||
self.save()
|
||||
|
|
Reference in a new issue