These `if` conditions will cause the queries in `proposals_by_confirmation` to be run twice unless you use a werkzeug cached_property (which caches in the SQLAlchemy object and is therefore valid until session flush).