Make tickerhandler correctly clean subs to deleted objs.

Also makes the dbunserialize mechanism a little more robust, making it return None instead of crashing when unpacking an invalid packed-tuple.
This commit is contained in:
Griatch 2016-06-14 22:03:44 +02:00
parent 25e1126809
commit bdcc093c23
2 changed files with 37 additions and 17 deletions

View file

@ -83,7 +83,11 @@ def _TO_DATESTRING(obj):
return _GA(obj, "db_date_created").strftime(_DATESTRING)
except AttributeError:
# this can happen if object is not yet saved - no datestring is then set
obj.save()
try:
obj.save()
except AttributeError:
# we have received a None object, for example due to an erroneous save.
return None
return _GA(obj, "db_date_created").strftime(_DATESTRING)