From dcf133905f7aacc0c6fe61022af8103f895d648d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 21 Jun 2018 11:22:24 +0000 Subject: Check if the variable is not None before using strip() --- wallace/module_invitationpolicy.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'wallace/module_invitationpolicy.py') diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py index 6aee7b0..034b5d9 100644 --- a/wallace/module_invitationpolicy.py +++ b/wallace/module_invitationpolicy.py @@ -1178,7 +1178,9 @@ def send_update_notification(object, receiving_user, old=None, reply=True, sende orgname = organizer.name() itip_comment = None - comment = comment.strip() + if comment is not None: + comment = comment.strip() + if sender is not None and not comment == '': itip_comment = _("%s commented: %s") % (_attendee_name(sender), comment) @@ -1332,7 +1334,9 @@ def send_cancel_notification(object, receiving_user, deleted=False, sender=None, else: message_text += " " + _("The copy in your calendar has been marked as cancelled accordingly.") - comment = comment.strip() + if comment is not None: + comment = comment.strip() + if sender is not None and not comment == '': message_text += "\n" + _("%s commented: %s") % (_attendee_name(sender), comment) -- cgit v1.1