Commit 2b7d147
authored
Fix bug caused by child having multiple terms set under the index order by classifier (#617)
Currently, if a page has `index_order_by_classifier` set, and one or
more of its live children have more than one `ClassifierTerm` under that
classifier set, Django will return a programming error `more than one
row returned by a subquery used as an expression`.
This makes sense, as it is trying to sort on an order that is non
deterministic. To fix, we slice the queryset to only ever contain a
single term, which should also always be the highest order term due to
the default ordering for the classifier terms.1 parent 9591169 commit 2b7d147
3 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments