|
17 | 17 | from django.utils.encoding import smart_str |
18 | 18 |
|
19 | 19 | from ietf.dbtemplate.models import DBTemplate |
20 | | -from ietf.person.models import Email, Person |
| 20 | +from ietf.person.models import Email, Person, Alias |
21 | 21 | from ietf.utils.pipe import pipe |
22 | 22 | from ietf.utils import unaccent |
23 | 23 | from ietf.utils.mail import send_mail_text, send_mail |
@@ -280,10 +280,14 @@ def get_or_create_nominee(nomcom, candidate_name, candidate_email, position, aut |
280 | 280 | # Create person and email if candidate email does't exist and send email |
281 | 281 | email, created_email = Email.objects.get_or_create(address=candidate_email) |
282 | 282 | if created_email: |
283 | | - email.person = Person.objects.create(name=candidate_name, |
284 | | - ascii=unaccent.asciify(candidate_name), |
285 | | - address=candidate_email) |
| 283 | + person = Person.objects.create(name=candidate_name, |
| 284 | + ascii=unaccent.asciify(candidate_name), |
| 285 | + address=candidate_email) |
| 286 | + email.person = person |
286 | 287 | email.save() |
| 288 | + Alias.objects.create(name=person.name, person=person) |
| 289 | + if person.name != person.ascii: |
| 290 | + Alias.objects.create(name=person.ascii, person=person) |
287 | 291 |
|
288 | 292 | # Add the nomination for a particular position |
289 | 293 | nominee, created = Nominee.objects.get_or_create(email=email, nomcom=nomcom) |
|
0 commit comments