Commit 2b792b7
committed
fix(gui): flush ORM objects before raw rule_elements INSERT
Duplicating a device (copy-paste between subfolders) silently failed
because raw rule_elements INSERT statements ran before the ORM-managed
rule and rule_set objects were flushed to the DB, causing FK constraint
violations that PySide6 swallowed.
Restructure _duplicate_device_children to collect source rule_element
rows first, explicitly flush() all ORM objects, then insert the raw
rule_elements rows.1 parent e136efe commit 2b792b7
1 file changed
Lines changed: 23 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
436 | 440 | | |
437 | 441 | | |
438 | 442 | | |
| |||
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
444 | | - | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
459 | 470 | | |
| 471 | + | |
460 | 472 | | |
461 | 473 | | |
462 | 474 | | |
| |||
0 commit comments