deb-horizon/horizon/utils/functions.py
Tihomir Trifonov 68e612d37f Added a check for None value in get_object_display
When get_object_display returns None,
the concatenation of the list of display values fails.

Fixes bug 1030641

PATCH SET 2: Added function for joining of
lazy(proxy) strings(similar to string_concat)

Change-Id: I76398e85f93bc508aaae056aca77c8103998c7b6
2012-08-07 11:48:47 +03:00

10 lines
256 B
Python

from django.utils.encoding import force_unicode
from django.utils.functional import lazy
def _lazy_join(separator, strings):
return separator.join([force_unicode(s)
for s in strings])
lazy_join = lazy(_lazy_join, unicode)