diff options
author | Aleksander Machniak <machniak@kolabsys.com> | 2018-06-21 11:22:24 +0000 |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2018-06-21 11:22:24 +0000 |
commit | dcf133905f7aacc0c6fe61022af8103f895d648d (patch) | |
tree | 613295dc45a5e683d5bd296bd96408a1bcef4a63 /wallace | |
parent | df84f862a9a27f09def5e8b19cbb60e4e7c700b9 (diff) | |
download | pykolab-dcf133905f7aacc0c6fe61022af8103f895d648d.tar.gz |
Check if the variable is not None before using strip()
Diffstat (limited to 'wallace')
-rw-r--r-- | wallace/module_invitationpolicy.py | 8 |
1 files changed, 6 insertions, 2 deletions
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) |