From 74073a6f22bf41b5a9f6dcbc0b7c6e912b55f4c6 Mon Sep 17 00:00:00 2001 From: jomae Date: Thu, 6 Feb 2025 02:07:01 +0000 Subject: [PATCH] 1.6.1dev: follow-up to [17878], fix unable to save //not-configured// in syntax highlighting of user preferences (refs #13864) git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.6-stable@17881 af82e41b-90c4-0310-8c96-b1721e28e2e2 --- trac/mimeview/pygments.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trac/mimeview/pygments.py b/trac/mimeview/pygments.py index c3fa038346..7e9cabf87d 100644 --- a/trac/mimeview/pygments.py +++ b/trac/mimeview/pygments.py @@ -174,7 +174,9 @@ def style_defs(style): if default_style not in styles: default_style = 'trac' selection = req.session.get('pygments_style') - if selection not in styles: + if not selection: + selection = '' + elif selection not in styles: selection = default_style output = self._generate('html', self.EXAMPLE) add_script_data(req, default_style=default_style, selection=selection)