Change get_herited method
This commit is contained in:
parent
ef8c62835b
commit
782cb34b0e
1 changed files with 3 additions and 3 deletions
|
@ -178,7 +178,7 @@ class Activity(AbstractActivityTemplate):
|
|||
inherited_fields = [f.name for f in ActivityTemplate._meta.get_fields()]
|
||||
m2m_fields = [f.name for f in ActivityTemplate._meta.get_fields()
|
||||
if f.many_to_many]
|
||||
attr = super(Activity, self).__getattribute__(attrname)
|
||||
attr = getattr(self, attrname)
|
||||
if attrname not in inherited_fields:
|
||||
raise FieldError(
|
||||
_("%(attrname)s n'est pas un champ héritable"),
|
||||
|
@ -188,9 +188,9 @@ class Activity(AbstractActivityTemplate):
|
|||
if attr.exists():
|
||||
return attr
|
||||
else:
|
||||
return self.parent.__getattribute__(attrname)
|
||||
return getattr(self.parent, attrname)
|
||||
elif attr is None:
|
||||
return self.parent.__getattribute__(attrname)
|
||||
return getattr(self.parent, attrname)
|
||||
else:
|
||||
return attr
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue