Fix some db.changes
stuff for tests...
This commit is contained in:
parent
ebe2ce8109
commit
08dd2d000a
|
@ -116,6 +116,11 @@ class ChangeRecorder(object):
|
|||
|
||||
# Does the other class mapper's relationship wish to delete orphans?
|
||||
# other_relationship = relationship.mapper.relationships[backref]
|
||||
|
||||
# Sometimes backrefs are tuples; first element is name.
|
||||
if isinstance(backref, tuple):
|
||||
backref = backref[0]
|
||||
|
||||
other_relationship = relationship.mapper.get_property(backref)
|
||||
if other_relationship.cascade.delete_orphan:
|
||||
|
||||
|
@ -137,10 +142,8 @@ class ChangeRecorder(object):
|
|||
ignored.
|
||||
"""
|
||||
|
||||
# No need to record changes for changes. Must not use `isinstance()`
|
||||
# here due to mocking in tests.
|
||||
if (hasattr(instance.__class__, '__tablename__')
|
||||
and instance.__class__.__tablename__ == 'changes'):
|
||||
# No need to record changes for changes.
|
||||
if isinstance(instance, model.Change):
|
||||
return False
|
||||
|
||||
# No need to record changes for batch data.
|
||||
|
|
Loading…
Reference in a new issue