Sometimes I can generate a project and it'll work just fine. Minutes later, part of it fails, unpredictably, at different points in the process. The variables don't populate into the template.
I don't know why I'm getting these failures, but a workaround is to insert with a filter like
{{ variablename | dieifblank }}. They seem to fail as type None.
The working code:
def filter_dieifblank(s):
from sys import exit
if not s:
print("!!!!!!!!!!\r\n!!!!!!!!!!!\r\n!!!!!!!!!!!!\r\n!!!!!!!!!!!!!\r\r!!!!!!!!!!!!!!!!!!")
print("We got a None value where you wanted substance.")
exit()
elif len(s) == 0:
print("!!!!!!!!!!\r\n!!!!!!!!!!!\r\n!!!!!!!!!!!!\r\n!!!!!!!!!!!!!\r\r!!!!!!!!!!!!!!!!!!")
print("We got an empty but defined string")
exit()
else:
return s```
Sometimes I can generate a project and it'll work just fine. Minutes later, part of it fails, unpredictably, at different points in the process. The variables don't populate into the template.
I don't know why I'm getting these failures, but a workaround is to insert with a filter like
{{ variablename | dieifblank }}. They seem to fail as type None.The working code: