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:
parent
25e1126809
commit
bdcc093c23
2 changed files with 37 additions and 17 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue