mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Implemented LazyI18nString.__bool__ to return False on empty strings
This commit is contained in:
@@ -40,6 +40,9 @@ class LazyI18nString:
|
||||
"""
|
||||
return self.localize(translation.get_language())
|
||||
|
||||
def __bool__(self):
|
||||
return bool(len(self.data)) and any(self.data.values())
|
||||
|
||||
def localize(self, lng):
|
||||
if self.data is None:
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user