Changeset - 129244cfc086
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 5 years ago 2021-02-16 23:41:17
mads@kiilerich.com
Grafted from: 98ca8164fdfb
db: make ChangesetStatus.get_status return an actual string that can be joined and used in mako templates
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/model/db.py
Show inline comments
 
@@ -1974,13 +1974,13 @@ class ChangesetStatus(meta.Base, BaseDbM
 
            self.__class__.__name__,
 
            self.status, self.author
 
        )
 

	
 
    @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):
 
        return ChangesetStatus.get_status_lbl(self.status)
 

	
 
    def __json__(self):
kallithea/model/notification.py
Show inline comments
 
@@ -189,13 +189,13 @@ class EmailNotificationModel(object):
 
            raise
 
        # gmail doesn't do proper threading but will ignore leading square
 
        # bracket content ... so that is where we put status info
 
        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:
 
            if subj.startswith('['):
 
                subj = '[' + ', '.join(bracket_tags) + ': ' + subj[1:]
 
            else:
0 comments (0 inline, 0 general)