changeset 8855:129244cfc086

db: make ChangesetStatus.get_status return an actual string that can be joined and used in mako templates
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 16 Feb 2021 23:41:17 +0100
parents 278cc5936ed5
children 8014ac73587d
files kallithea/model/db.py kallithea/model/notification.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/db.py	Thu Jan 14 23:03:52 2021 +0100
+++ b/kallithea/model/db.py	Tue Feb 16 23:41:17 2021 +0100
@@ -1977,7 +1977,7 @@
 
     @classmethod
     def get_status_lbl(cls, value):
-        return cls.STATUSES_DICT.get(value)
+        return str(cls.STATUSES_DICT.get(value))  # using str to evaluate translated LazyString at runtime
 
     @property
     def status_lbl(self):
--- a/kallithea/model/notification.py	Thu Jan 14 23:03:52 2021 +0100
+++ b/kallithea/model/notification.py	Tue Feb 16 23:41:17 2021 +0100
@@ -192,7 +192,7 @@
         bracket_tags = []
         status_change = kwargs.get('status_change')
         if status_change:
-            bracket_tags.append(str(status_change))  # apply str to evaluate LazyString before .join
+            bracket_tags.append(status_change)
         if kwargs.get('closing_pr'):
             bracket_tags.append(_('Closing'))
         if bracket_tags: