Fix missing role.email -> role.person query

- Legacy-Id: 3427
This commit is contained in:
Ole Laursen 2011-09-16 15:10:16 +00:00
parent 022bc51e23
commit 6d400d6f87
5 changed files with 21 additions and 1 deletions

3
redesign/importing/import-all.sh Normal file → Executable file
View file

@ -1,4 +1,7 @@
#!/bin/bash
# basic dependencies
set -e
python import-persons.py
python import-groups.py
python import-roles.py

View file

@ -81,7 +81,7 @@ for o in Announcement.objects.all().select_related('announced_to', 'announced_fr
if o.nomcom:
nomcom = Group.objects.filter(role__name="chair",
role__email__person=old_person_to_person(o.nomcom_chair.person),
role__person=old_person_to_person(o.nomcom_chair.person),
acronym__startswith="nomcom").exclude(acronym="nomcom").get()
message.related_groups.add(nomcom)

View file

@ -81,6 +81,14 @@ rsoc_group.state = state_names["active"]
rsoc_group.type = type_names["ietf"]
rsoc_group.save()
# create IAB for use with liaison statements
iab_group, _ = Group.objects.get_or_create(acronym="iab")
iab_group.name = "Internet Architecture Board"
iab_group.state = state_names["active"]
iab_group.type = type_names["ietf"]
iab_group.save()
system = Person.objects.get(name="(System)")

View file

@ -289,6 +289,8 @@ for o in WgMeetingSession.objects.all().order_by("pk"):
s.attendees = o.number_attendee
s.agenda_note = (o.special_agenda_note or "").strip()
s.requested = o.requested_date or obviously_bogus_date
print o.requested_by_id
print o.requested_by
s.requested_by = old_person_to_person(o.requested_by) if o.requested_by else system_person
s.requested_duration = requested_length_mapping[getattr(o, "length_session%s" % i)]
s.comments = (o.special_req or "").strip()

View file

@ -93,6 +93,13 @@ def get_or_create_email(o, create_fake):
e.person = p
e.save()
else:
if e.person.name != name:
Alias.objects.create(name=name, person=e.person)
# take longest name rather than the first we encounter
if len(name) > e.person.name:
e.person.name = name
e.person.save()
return e