Skip to content

Commit 9ca9eb3

Browse files
committed
Fix two bugs in RFC Editor syncing: make sure documents we don't know
beforehand get a "draft" type and make sure individually submitted drafts get the type="individ" group instead of NULL - Legacy-Id: 5282
1 parent aa70cff commit 9ca9eb3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ietf/sync/rfceditor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def update_docs_from_rfc_index(data, skip_older_than_date=None):
327327

328328
if not doc:
329329
results.append("created document %s" % name)
330-
doc = Document.objects.get_or_create(name=name)[0]
330+
doc = Document.objects.create(name=name, type=DocTypeName.objects.get(slug="draft"))
331331

332332
# add alias
333333
DocAlias.objects.get_or_create(name=name, document=doc)
@@ -358,8 +358,11 @@ def update_docs_from_rfc_index(data, skip_older_than_date=None):
358358
if doc.stream != stream_mapping[stream]:
359359
changed_attributes["stream"] = stream_mapping[stream]
360360

361-
if not doc.group and wg:
362-
changed_attributes["group"] = Group.objects.get(acronym=wg)
361+
if not doc.group: # if we have no group assigned, check if RFC Editor has a suggestion
362+
if wg:
363+
changed_attributes["group"] = Group.objects.get(acronym=wg)
364+
else:
365+
changed_attributes["group"] = Group.objects.get(type="individ")
363366

364367
if not doc.latest_event(type="published_rfc"):
365368
e = DocEvent(doc=doc, type="published_rfc")

0 commit comments

Comments
 (0)