Removing duplicacy in email(attendee)

I have follow the tutorial video code.
But I am not able to remove duplicacy in email when we select same attendee twice.
my python code is:


Is it right code?
Is der any need to change is js code also?

Does it raising exception for duplicate attendee

then what should I do?
for generating alert