Commit c09b987
committed
fix: eliminate redundant workflow DB queries and admin list N+1 (v0.37.14)
tasks.py:
- send_rejection/approval/submission/withdrawal_notification: read
hide_approval_history from already-resolved local workflow var
instead of calling _get_hide_approval_history(submission) which
issued a duplicate workflows.first() DB query
- send_submission_form_field_notifications: resolve workflow once
before the notification loop; pre-compute hide_approval_history
- send_workflow_definition_notifications: same pattern, resolve
workflow and hide_approval_history once before the loop
admin.py:
- WorkflowNotificationAdmin: add list_select_related =
(workflow__form_definition,) to eliminate the 2-query N+1 on
the list page caused by workflow_form() traversing the FK chain
Bump 0.37.13 to 0.37.141 parent 0572ec6 commit c09b987
4 files changed
Lines changed: 29 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
| 1539 | + | |
1539 | 1540 | | |
1540 | 1541 | | |
1541 | 1542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
333 | 335 | | |
334 | 336 | | |
335 | 337 | | |
| |||
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
377 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
378 | 382 | | |
379 | 383 | | |
380 | 384 | | |
| |||
417 | 421 | | |
418 | 422 | | |
419 | 423 | | |
420 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
421 | 427 | | |
422 | 428 | | |
423 | 429 | | |
| |||
955 | 961 | | |
956 | 962 | | |
957 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
958 | 967 | | |
959 | 968 | | |
960 | 969 | | |
| |||
997 | 1006 | | |
998 | 1007 | | |
999 | 1008 | | |
1000 | | - | |
| 1009 | + | |
1001 | 1010 | | |
1002 | 1011 | | |
1003 | 1012 | | |
| |||
1029 | 1038 | | |
1030 | 1039 | | |
1031 | 1040 | | |
1032 | | - | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1033 | 1044 | | |
1034 | 1045 | | |
1035 | 1046 | | |
| |||
1094 | 1105 | | |
1095 | 1106 | | |
1096 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1097 | 1111 | | |
1098 | 1112 | | |
1099 | 1113 | | |
| |||
1150 | 1164 | | |
1151 | 1165 | | |
1152 | 1166 | | |
1153 | | - | |
| 1167 | + | |
1154 | 1168 | | |
1155 | 1169 | | |
1156 | 1170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments