Commit 407eb9ed authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_project: notify assignee only if he has an email address

parent 965839b4
......@@ -85,12 +85,15 @@ destination_decision_person = task_report.getDestinationDecisionValue(portal_typ
if destination_decision_person is None:\n
destination_decision_person = task_report.getDestinationValue(portal_type="Person")\n
\n
# We send a message only if the requester have an email and the assignee \n
# is an user that can view the task report.\n
if source_person is not None \\\n
and destination_decision_person is not None \\\n
and destination_decision_person.getDefaultEmailText() \\\n
and destination_decision_person.getReference():\n
# We send a message only if the requester has an email\n
# and the assignee has one too and is an user that can view the task report.\n
if (\n
source_person is not None and\n
source_person.getDefaultEmailText() and # XXX Add unit test: check if task confirmation works if assignee has no mail\n
destination_decision_person is not None and\n
destination_decision_person.getDefaultEmailText() and\n
destination_decision_person.getReference()\n
):\n
if len(portal.acl_users.erp5_users.getUserByLogin(source_person.getReference())):\n
message = """A new task has been assigned to you by %(assignor)s.\n
\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment