From 739179a152c76c0afb941b669162c9a5d63c6758 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 13 Nov 2023 17:44:40 +0000 Subject: [PATCH] Fix crash on user deletion due to game support --- app/models/packages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/packages.py b/app/models/packages.py index c5327e91..069aa1f7 100644 --- a/app/models/packages.py +++ b/app/models/packages.py @@ -411,10 +411,10 @@ class Package(db.Model): dependencies = db.relationship("Dependency", back_populates="depender", lazy="dynamic", foreign_keys=[Dependency.depender_id]) supported_games = db.relationship("PackageGameSupport", back_populates="package", lazy="dynamic", - foreign_keys=[PackageGameSupport.package_id]) + foreign_keys=[PackageGameSupport.package_id], cascade="all, delete, delete-orphan") game_supported_mods = db.relationship("PackageGameSupport", back_populates="game", lazy="dynamic", - foreign_keys=[PackageGameSupport.game_id]) + foreign_keys=[PackageGameSupport.game_id], cascade="all, delete, delete-orphan") tags = db.relationship("Tag", secondary=Tags, back_populates="packages")