Problem with example in the docs
In the example: "E-mailing or texting the user a link for purposes of using the touchscreen" https://docassemble.org/docs/recipes.html#hybrid
There is a version has multi_user=False where the first interview references: second-interview.yml.
When trying this example the user always ends up at the: timeout_screen and never at the final_screen
When trying to find the error I discovered that removing the line: r.delete(redis_key) fixes this issue.
However the key thus remains in the DB which clearly is not optimal...
Thanks. I didn't realize the logic in the mandatory block was non-idempotent. I rewrote it so it doesn't have that problem any more.
Thanks have to read up on non-idempotency in the docs!
Question: it appears to me that the code can be further simplified. The variable signature_obtained is redundant and can be removed and the same goes for two of the del result statements.
I thus changed the first code block to :
---
mandatory: True
code: |
email_sent
signature
final_screen
---
and the last to:
---
code: |
result = r.get_data(redis_key)
if result is None:
timeout_screen
elif result == 'waiting':
waiting_screen
signature = DAFile('signature')
signature.initialize(filename="signature.png")
signature.write(result, binary=True)
signature.commit()
r.delete(redis_key)
del result
Let me know if I am missing something?
I'm going through old GitHub issues and I saw I didn't respond to this. I think the difference is probably just a matter of style. If it works correctly the way you have it, that should be fine.