From 088cfe8902b106446398f8805557fea137d241c6 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Fri, 20 Oct 2023 08:51:38 -0700 Subject: [PATCH] fix: fix sorting tags on MySQL --- openedx_tagging/core/tagging/models/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openedx_tagging/core/tagging/models/base.py b/openedx_tagging/core/tagging/models/base.py index 5428f686..6ac9d04c 100644 --- a/openedx_tagging/core/tagging/models/base.py +++ b/openedx_tagging/core/tagging/models/base.py @@ -470,6 +470,7 @@ def _get_filtered_tags_deep( Coalesce(ConcatNull(F("parent__parent__value"), Value("\t")), Value("")), Coalesce(ConcatNull(F("parent__value"), Value("\t")), Value("")), F("value"), + Value("\t"), # We also need the '\t' separator character at the end, or MySQL will sort things wrong output_field=models.CharField(), )) # Add the parent value