HonzaKral/django-threadedcomments — pull request #60 by Andertaker (2014-10-22 19:13:59+00:00)
Title: Fix invalid state, which happen if signals raise exception

If "super(ThreadedComment, self).save(*args, **kwargs)" is not last in save method,
then exceptions in functions called by post_save signal will lead to invalid DataBase state.

For example: field tree_path in DB will be ""(empty string), then
def root_id(self):
return int(self.tree_path.split(PATH_SEPARATOR)[0])
equivalent to int('') and return
ValueError: invalid literal for int() with base 10: ''
so whole page with comments will be broken.

So @transaction.atomic was added to fix it
All tests are passed