fix type checking: avoid error for objects not providing a type

This commit is contained in:
Helmut Merz 2014-01-22 16:59:24 +01:00
parent 94165f41bb
commit 9079d8e23e

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013 Helmut Merz helmutm@cy55.de # Copyright (c) 2014 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -59,8 +59,10 @@ class ChangeManager(BaseRecordManager):
return False return False
opt = self.options('organize.tracking.changes') opt = self.options('organize.tracking.changes')
if isinstance(opt, (list, tuple)): if isinstance(opt, (list, tuple)):
type = self.context.getType() if hasattr(self.context, 'getType'):
return type and getName(type) in opt type = self.context.getType()
return type and getName(type) in opt
return False
else: else:
return bool(opt) return bool(opt)