From 4c66b25e7ca071bf4d9ca784f183726685626ea0 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 30 Apr 2023 00:27:10 +0100 Subject: [PATCH] Fix crash on donate page --- app/blueprints/donate/__init__.py | 4 ++-- app/templates/donate/index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/blueprints/donate/__init__.py b/app/blueprints/donate/__init__.py index 549be043..516fdd97 100644 --- a/app/blueprints/donate/__init__.py +++ b/app/blueprints/donate/__init__.py @@ -1,6 +1,6 @@ from flask import Blueprint, render_template from flask_login import current_user -from sqlalchemy import or_ +from sqlalchemy import or_, and_ from app.models import User, Package, PackageState, db, License, PackageReview @@ -13,7 +13,7 @@ def donate(): if current_user.is_authenticated: reviewed_packages = Package.query.filter( Package.state == PackageState.APPROVED, - Package.reviews.any(PackageReview.author_id == current_user.id, PackageReview.rating >= 3), + Package.reviews.any(and_(PackageReview.author_id == current_user.id, PackageReview.rating >= 3)), or_(Package.donate_url.isnot(None), Package.author.has(User.donate_url.isnot(None))) ).order_by(db.asc(Package.title)).all() diff --git a/app/templates/donate/index.html b/app/templates/donate/index.html index ecb33b7f..b890a03e 100644 --- a/app/templates/donate/index.html +++ b/app/templates/donate/index.html @@ -1,8 +1,8 @@ {% extends "base.html" %} -{% block title %} +{% block title -%} {{ _("Support packages") }} -{% endblock %} +{%- endblock %} {% macro authorlink(author) %}