From 9ca9eb350dc05d3e00d7b2965a4beadfca0b6108 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Thu, 17 Jan 2013 11:19:53 +0000 Subject: [PATCH] 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 --- ietf/sync/rfceditor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ietf/sync/rfceditor.py b/ietf/sync/rfceditor.py index ccb7f9032..c725f4726 100644 --- a/ietf/sync/rfceditor.py +++ b/ietf/sync/rfceditor.py @@ -327,7 +327,7 @@ def update_docs_from_rfc_index(data, skip_older_than_date=None): if not doc: results.append("created document %s" % name) - doc = Document.objects.get_or_create(name=name)[0] + doc = Document.objects.create(name=name, type=DocTypeName.objects.get(slug="draft")) # add alias 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): if doc.stream != stream_mapping[stream]: changed_attributes["stream"] = stream_mapping[stream] - if not doc.group and wg: - changed_attributes["group"] = Group.objects.get(acronym=wg) + if not doc.group: # if we have no group assigned, check if RFC Editor has a suggestion + if wg: + changed_attributes["group"] = Group.objects.get(acronym=wg) + else: + changed_attributes["group"] = Group.objects.get(type="individ") if not doc.latest_event(type="published_rfc"): e = DocEvent(doc=doc, type="published_rfc")