Skip to content

Erratic issue: Variables sometimes not properly passed into templates #459

@stucka

Description

@stucka

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```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions