Commit 045edf7d authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_project: notify assignee only if he has an email address

parent c3a00140
...@@ -85,12 +85,15 @@ destination_decision_person = task_report.getDestinationDecisionValue(portal_typ ...@@ -85,12 +85,15 @@ destination_decision_person = task_report.getDestinationDecisionValue(portal_typ
if destination_decision_person is None:\n if destination_decision_person is None:\n
destination_decision_person = task_report.getDestinationValue(portal_type="Person")\n destination_decision_person = task_report.getDestinationValue(portal_type="Person")\n
\n \n
# We send a message only if the requester have an email and the assignee \n # We send a message only if the requester has an email\n
# is an user that can view the task report.\n # and the assignee has one too and is an user that can view the task report.\n
if source_person is not None \\\n if (\n
and destination_decision_person is not None \\\n source_person is not None and\n
and destination_decision_person.getDefaultEmailText() \\\n source_person.getDefaultEmailText() and # XXX Add unit test: check if task confirmation works if assignee has no mail\n
and destination_decision_person.getReference():\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 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 message = """A new task has been assigned to you by %(assignor)s.\n
\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