Only try to update topics if you haven't just set them to None.

This commit is contained in:
Ray Schamp 2014-02-05 09:45:49 -05:00
parent ea6ef1dc91
commit fa6ea8011a

View file

@ -205,7 +205,7 @@ class Topic(models.Model):
tracking.last_read = timezone.now()
tracking.save()
#update topics if exist new post or does't exist in dict
if self.last_post_id > tracking.topics.get(str(self.id), 0):
elif self.last_post_id > tracking.topics.get(str(self.id), 0):
tracking.topics[str(self.id)] = self.last_post_id
tracking.save()
else: