Skip to content

Commit 16a2782

Browse files
committed
Fix NomCom naming, put a parent on RG, save ids on groups and output them on documents
- Legacy-Id: 3069
1 parent 920b2d2 commit 16a2782

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

redesign/import-document-state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ def import_from_idinternal(d, idinternal):
776776
#all_drafts = all_drafts.none()
777777

778778
for index, o in enumerate(all_drafts.iterator()):
779-
print "importing", o.filename, index
779+
print "importing", o.id_document_tag, o.filename, index
780780

781781
try:
782782
d = Document.objects.get(name=o.filename)

redesign/import-groups.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,22 @@ def name(name_class, slug, name, desc=""):
5454
iesg_group.type = type_names["ietf"]
5555
iesg_group.save()
5656

57+
# make sure we got the IRTF as parent for RGs
58+
irtf_group, _ = Group.objects.get_or_create(acronym="irtf")
59+
irtf_group.name = "IRTF"
60+
irtf_group.state = state_names["active"]
61+
irtf_group.type = type_names["ietf"]
62+
irtf_group.save()
63+
5764
system_email, _ = Email.objects.get_or_create(address="(System)")
5865

5966

6067
# NomCom
61-
Group.objects.filter(acronym="nominatingcom").delete()
68+
Group.objects.filter(acronym__startswith="nomcom").exclude(acronym="nomcom").delete()
6269

6370
for o in ChairsHistory.objects.filter(chair_type=Role.NOMCOM_CHAIR).order_by("start_year"):
6471
group = Group()
65-
group.acronym = "nominatingcom"
72+
group.acronym = "nomcom%s" % o.start_year
6673
group.name = "IAB/IESG Nominating Committee %s/%s" % (o.start_year, o.end_year)
6774
if o.chair_type.person == o.person:
6875
s = state_names["active"]
@@ -126,24 +133,21 @@ def name(name_class, slug, name, desc=""):
126133
group.name = o.name
127134
group.state = state_names["active"] # we assume all to be active
128135
group.type = type_names["rg"]
129-
130-
# FIXME: who is the parent?
131-
# group.parent = Group.objects.get(acronym=)
132-
print "no parent for", group.acronym, group.name, group.type, group.state
136+
group.parent = irtf_group
133137

134138
group.comments = o.charter_text or ""
135139

136140
group.save()
137141

138142
# FIXME: missing fields from old: meeting_scheduled
139143

140-
141144
# IETFWG, AreaGroup
142145
for o in IETFWG.objects.all():
143146
try:
144147
group = Group.objects.get(acronym=o.group_acronym.acronym)
145148
except Group.DoesNotExist:
146149
group = Group(acronym=o.group_acronym.acronym)
150+
group.id = o.group_acronym_id # transfer id
147151

148152
group.name = o.group_acronym.name
149153
# state

redesign/import-roles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_or_create_email(o, create_fake):
144144
Role.objects.get_or_create(name=chair_role, group=group, email=email)
145145

146146
# NomCom chairs
147-
nomcom_groups = list(Group.objects.filter(acronym="nominatingcom"))
147+
nomcom_groups = list(Group.objects.filter(acronym__startswith="nomcom").exclude(acronym="nomcom"))
148148
for o in ChairsHistory.objects.filter(chair_type=OldRole.NOMCOM_CHAIR):
149149
print "importing NOMCOM chair", o
150150
for g in nomcom_groups:

0 commit comments

Comments
 (0)