Files
notifications-admin/tests
Chris Hill-Scott cca19df73c Stop JSONModel hiding attribute errors
`__getattr__` is called whenever an attribute error is raised.

This means that if something deep inside a property on a model raised
an attribute error, that error would be caught by `__getattr__`, which
would then raise an exception that looked like the property itself
didn’t exist. Very confusing.

The solution seems to be to override `__getattribute__` instead, which
handles _all_ attributes, not just those that aren’t explicitly defined.
We then only intervene if the desired attribute is one of the
`ALLOWED_PROPERTIES`, otherwise falling through to the built in methods
of the underlying `object`.
2019-07-09 14:06:49 +01:00
..