From abf5af4253aa5f9e9165a2ec6be2b6dc460003f7 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 24 Mar 2016 17:09:11 +0100 Subject: [PATCH] Fixed bugs in LazyI18nString.__eq__ --- src/pretix/base/i18n.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/i18n.py b/src/pretix/base/i18n.py index 7bc91dd271..d131eab435 100644 --- a/src/pretix/base/i18n.py +++ b/src/pretix/base/i18n.py @@ -79,7 +79,11 @@ class LazyI18nString: return self.__str__() def __eq__(self, other): - return self.data == other.data + if other is None: + return False + if hasattr(other, 'data'): + return self.data == other.data + return self.data == other class LazyGettextProxy: def __init__(self, lazygettext):