Very minor, but I think you can just go with `if env.get('THEME_NAME'):` unless you need to check for None specifically.