changeset 2255:ba613d32ca60

plugin invitations: doesn't raise an exception anymore if url_template is not set while email is not requested
author Goffi <goffi@goffi.org>
date Sun, 21 May 2017 20:07:54 +0200
parents 6297817c3dc9
children 61e836cc9512
files src/plugins/plugin_misc_invitations.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_misc_invitations.py	Sun May 21 20:06:07 2017 +0200
+++ b/src/plugins/plugin_misc_invitations.py	Sun May 21 20:07:54 2017 +0200
@@ -165,7 +165,9 @@
 
         self.checkExtra(extra)
 
-        if not 'url_template' in kwargs and not 'message_body' in kwargs:
+        email = kwargs.pop(u'email', None)
+
+        if email is not None and not 'url_template' in kwargs and not 'message_body' in kwargs:
             raise ValueError(_(u"You need to provide url_template if you use default message body"))
 
 
@@ -229,7 +231,6 @@
         language = kwargs.pop(u'language', None)
         if language is not None:
             extra[u'language'] = language
-        email = kwargs.pop(u'email', None)
 
         if email is not None:
             extra[u'email'] = email