Skip to content

Commit

Permalink
Merge 17c4488 into e143778
Browse files Browse the repository at this point in the history
  • Loading branch information
xzzy committed Aug 2, 2019
2 parents e143778 + 17c4488 commit 885528a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ledger/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
from ledger.address.models import UserAddress, Country


def unicode_compatible(value):
try:
return unicode(value)
except:
return str(value)


class EmailUserManager(BaseUserManager):
"""A custom Manager for the EmailUser model.
Expand Down Expand Up @@ -199,7 +205,7 @@ def active_address_fields(self):
#for f in fields:
# print unicode(f).encode('utf-8').decode('unicode-escape').strip()
#fields = [str(f).strip() for f in fields if f]
fields = [unicode(f).encode('utf-8').decode('unicode-escape').strip() for f in fields if f]
fields = [unicode_compatible(f).encode('utf-8').decode('unicode-escape').strip() for f in fields if f]

return fields

Expand Down

0 comments on commit 885528a

Please sign in to comment.