Event Participant hidden and visible errors

Description of the issue

Event Participant addition and removal in Event triggers an error.

Context information (for bug reports)

When in Event a participant is removed of the Participant Table, an error message occurs (Communication not Found).

Browsing the code, I found this error was the consequence of a non-displayed error occuring when a participant is added by a non Administrator User. The error is “Administrator is not a Valid Address”.
You can see this error for example by adding a Participant with a custom script.

In summary I think the cause of this is the Event Doctype trying to create a communication when a Participant is added and filling the (not mandatory as it is a Meeting Type communication) sender field with Administrator.

Steps to reproduce the issue

  1. Go to Event
  2. Add a participant in the Participant Table
  3. Remove him

Observed result

Communication not Found Error.

Expected result

No error whatsoever.

Additional information

Ubuntu, last Frappe version

Potential Fix

Prevent filling the sender field in case of a meeting type communication.

Now reported on github too