Changeset 7c91535 in rattail


Ignore:
Timestamp:
07/18/2022 12:21:56 PM (7 months ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
331a31b
Parents:
b5688a0
Message:

Properly encode output for str(Brand)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rattail/db/model/products.py

    rb5688a0 r7c91535  
    8585
    8686
    87 @six.python_2_unicode_compatible
    8887class Brand(Base):
    8988    """
     
    110109
    111110    def __str__(self):
    112         return self.name or ''
     111        text = self.name or ''
     112        if six.PY2:
     113            return text.encode('utf8')
     114        return text
     115
     116    if six.PY2:
     117        def __unicode__(self):
     118            return self.name or ''
    113119
    114120
Note: See TracChangeset for help on using the changeset viewer.