mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Translate page: Add translation_url to query
This commit is contained in:
parent
7a108e1199
commit
5223c2c47b
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
from flask import Blueprint, render_template, request
|
from flask import Blueprint, render_template, request
|
||||||
|
from sqlalchemy import or_
|
||||||
|
|
||||||
from app.models import Package, PackageState, db, PackageTranslation
|
from app.models import Package, PackageState, db, PackageTranslation
|
||||||
|
|
||||||
@ -26,7 +27,10 @@ bp = Blueprint("translate", __name__)
|
|||||||
def translate():
|
def translate():
|
||||||
query = Package.query.filter(
|
query = Package.query.filter(
|
||||||
Package.state == PackageState.APPROVED,
|
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")
|
has_langs = request.args.getlist("has_lang")
|
||||||
for lang in has_langs:
|
for lang in has_langs:
|
||||||
|
Loading…
Reference in New Issue
Block a user