Fix deleted packaging being show on todo page

Fixes #401
This commit is contained in:
rubenwardy 2023-01-02 19:16:51 +00:00
parent 38baea3dcf
commit 31a748b0b3

@ -170,17 +170,18 @@ def view_user(username=None):
abort(403) abort(403)
unapproved_packages = user.packages \ unapproved_packages = user.packages \
.filter(or_(Package.state == PackageState.WIP, .filter(or_(Package.state == PackageState.WIP,
Package.state == PackageState.CHANGES_NEEDED)) \ Package.state == PackageState.CHANGES_NEEDED)) \
.order_by(db.asc(Package.created_at)).all() .order_by(db.asc(Package.created_at)).all()
packages_with_no_screenshots = user.maintained_packages.filter( 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 \ packages_with_small_screenshots = user.maintained_packages \
.filter(Package.screenshots.any(and_(PackageScreenshot.width < PackageScreenshot.SOFT_MIN_SIZE[0], .filter(Package.state != PackageState.DELETED,
PackageScreenshot.height < PackageScreenshot.SOFT_MIN_SIZE[1]))) \ Package.screenshots.any(and_(PackageScreenshot.width < PackageScreenshot.SOFT_MIN_SIZE[0],
.all() PackageScreenshot.height < PackageScreenshot.SOFT_MIN_SIZE[1]))) \
.all()
outdated_packages = user.maintained_packages \ outdated_packages = user.maintained_packages \
.filter(Package.state != PackageState.DELETED, .filter(Package.state != PackageState.DELETED,