def try_post_deploy(): """Runs post_deploy() iff it has not been run for this version yet.""" version_info = VersionInfo.get_by_key_name( os.environ['CURRENT_VERSION_ID']) if not version_info: q = VersionInfo.all() q.order('-blogokay_major') q.order('-blogokay_minor') q.order('-blogokay_rev') post_deploy(q.get())