From 31a748b0b3409b96d301fe17b5551aeee1ae4863 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 2 Jan 2023 19:16:51 +0000 Subject: [PATCH] Fix deleted packaging being show on todo page Fixes #401 --- app/blueprints/todo/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/blueprints/todo/__init__.py b/app/blueprints/todo/__init__.py index 00ae937d..960c4932 100644 --- a/app/blueprints/todo/__init__.py +++ b/app/blueprints/todo/__init__.py @@ -170,17 +170,18 @@ def view_user(username=None): abort(403) unapproved_packages = user.packages \ - .filter(or_(Package.state == PackageState.WIP, - Package.state == PackageState.CHANGES_NEEDED)) \ - .order_by(db.asc(Package.created_at)).all() + .filter(or_(Package.state == PackageState.WIP, + Package.state == PackageState.CHANGES_NEEDED)) \ + .order_by(db.asc(Package.created_at)).all() packages_with_no_screenshots = user.maintained_packages.filter( - ~Package.screenshots.any(), Package.state == PackageState.APPROVED).all() + ~Package.screenshots.any(), Package.state == PackageState.APPROVED).all() packages_with_small_screenshots = user.maintained_packages \ - .filter(Package.screenshots.any(and_(PackageScreenshot.width < PackageScreenshot.SOFT_MIN_SIZE[0], - PackageScreenshot.height < PackageScreenshot.SOFT_MIN_SIZE[1]))) \ - .all() + .filter(Package.state != PackageState.DELETED, + Package.screenshots.any(and_(PackageScreenshot.width < PackageScreenshot.SOFT_MIN_SIZE[0], + PackageScreenshot.height < PackageScreenshot.SOFT_MIN_SIZE[1]))) \ + .all() outdated_packages = user.maintained_packages \ .filter(Package.state != PackageState.DELETED,