From 5223c2c47b31ff4ae2a98683980b596f6df9b5d7 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 3 Mar 2024 14:51:19 +0000 Subject: [PATCH] Translate page: Add translation_url to query --- app/blueprints/translate/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/blueprints/translate/__init__.py b/app/blueprints/translate/__init__.py index 2a1dc83c..46f93014 100644 --- a/app/blueprints/translate/__init__.py +++ b/app/blueprints/translate/__init__.py @@ -16,6 +16,7 @@ from flask import Blueprint, render_template, request +from sqlalchemy import or_ from app.models import Package, PackageState, db, PackageTranslation @@ -26,7 +27,10 @@ bp = Blueprint("translate", __name__) def translate(): query = Package.query.filter( Package.state == PackageState.APPROVED, - Package.translations.any(PackageTranslation.language_id != "en")) + or_( + Package.translation_url.is_not(None), + Package.translations.any(PackageTranslation.language_id != "en") + )) has_langs = request.args.getlist("has_lang") for lang in has_langs: