Profiles: fix loaded profile reach reference (caused a crash during certain operations involving the profile table)

new_design_pol
Dylan Jeannin 2026-09-01 16:31:33 +02:00
parent a88a164ead
commit 70128bbdd1
1 changed files with 3 additions and 1 deletions

View File

@ -80,11 +80,13 @@ class Reach(SQLSubModel):
@classmethod @classmethod
def _db_load(cls, execute, data=None): def _db_load(cls, execute, data=None):
new = cls(status=data["status"], parent=data["reach"]) new = cls(status=data["status"], parent=data["reach"])
profile_data = data.copy()
profile_data["reach"] = new
new._profiles = sorted( new._profiles = sorted(
ProfileXYZ._db_load( ProfileXYZ._db_load(
execute, execute,
data=data.copy() data=profile_data
), ),
key=lambda p: p._db_ind key=lambda p: p._db_ind
) )