Edited:
When there's some kind of error with a dunder method, docassemble doesn't raise the right error, making it hard to diagnose the issue, in this case a caught hasattr() error.
Reproduction
YAML:
---
objects:
- test_obj: DAObject
---
mandatory: True
question: |
Bug Reproduction — Stale `pending_error`
subquestion: |
Step 1: ${ hasattr(test_obj, 'nonexistent') }
Step 2: ${ test_obj.__custom__ }
---
Result:
Interview has an error. There was a reference to a variable 'test_obj.nonexistent'
that could not be looked up in the question file (for language 'en') or in any of
the files incorporated by reference into the question file.
Docassemble seeks a question for test_obj.nonexistent which was only ever checked via hasattr(). The actual expression is test_obj.__custom__.
Expected result:
An error about test_obj.__custom__, not the caught hasattr() error about a different variable.
Edited:
When there's some kind of error with a dunder method, docassemble doesn't raise the right error, making it hard to diagnose the issue, in this case a caught
hasattr()error.Reproduction
YAML:
Result:
Docassemble seeks a question for
test_obj.nonexistentwhich was only ever checked viahasattr(). The actual expression istest_obj.__custom__.Expected result:
An error about
test_obj.__custom__, not the caughthasattr()error about a different variable.