diff --git a/ietf/api/views.py b/ietf/api/views.py index 9d6b94f59a3..b45c14fa3dd 100644 --- a/ietf/api/views.py +++ b/ietf/api/views.py @@ -520,6 +520,7 @@ def create_demo_draft(request): request_params = json.loads(request.body) name = request_params.get("name") states = request_params.get("states") + stream_id = request_params.get("stream_id", "ietf") exists = False doc = None if not name: @@ -528,8 +529,13 @@ def create_demo_draft(request): if doc: exists = True else: - kwargs = {"name": name} + kwargs = {"name": name, "stream_id": stream_id} if states: kwargs["states"] = states - doc = WgDraftFactory(**kwargs) + doc = WgDraftFactory(**kwargs) # Yes, things may be a little strange if the stream isn't IETF, but until we nned something different... + event_type = "iesg_approved" if stream_id == "ietf" else "requested_publication" + if not doc.docevent_set.filter(type=event_type).exists() # Not using get_or_crete here on purpose - these are wobbly facades we're creating + doc.docevent_set.create(type=event_type, by_id=1, desc="Sent off to the RPC") return JsonResponse({ "doc_id":doc.pk, "name":doc.name }) + + diff --git a/rpcapi.yaml b/rpcapi.yaml index 6fe632438a2..a170f06eb25 100644 --- a/rpcapi.yaml +++ b/rpcapi.yaml @@ -91,6 +91,8 @@ paths: properties: name: type: string + stream_id: + type: string states: type: array items: