Commit a6a2c65
committed
[fix] Ensure VpnClient post_delete signal fires on template removal openwisp#1221
Replaced QuerySet.delete() with per-instance .delete() calls
so that post_delete signals fire correctly for each VpnClient.
Wrapped both deletion loops in transaction.atomic() to ensure
atomicity and prevent partial deletions on failure, consistent
with the pattern already used in serializers.py.
Used .iterator() for memory-safe iteration over potentially
large querysets.
Signed-off-by: prakash-kalwaniya <kalwaniyaprakash1@gmail.com>1 parent d203490 commit a6a2c65
2 files changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
206 | 209 | | |
207 | 210 | | |
208 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| |||
0 commit comments