datatracker/ietf/doc/migrations/0050_editorial_stream_states.py
Robert Sparks afac1f8f19
feat: enable editorial stream adoption and balloting (#5011)
* feat: enable editorial stream adoption and balloting

* fix: bring tests into line with refactor

* feat: force intended_std_level to Informational when adopting into a non-ietf stream.

* fix: improve blocking position labels and email content

* fix: simplify pointer to group on doc main page for rswg docs

* fix: recover from merge typos

* fix: correct defer and clear ballot behavior

* fix: improve publication request access logic

* fix: clean up broken editorial state

* fix: adjust test to match migrations
2023-01-31 13:50:51 -06:00

44 lines
1.4 KiB
Python

# Copyright The IETF Trust 2022, All Rights Reserved
from django.db import migrations
def forward(apps, schema_editor):
State = apps.get_model("doc", "State")
StateType = apps.get_model("doc", "StateType")
StateType.objects.create(
slug="draft-stream-editorial", label="Editorial stream state"
)
for slug, name, order in (
("repl", "Replaced editorial stream document", 0),
("active", "Active editorial stream document", 2),
("rsabpoll", "Editorial stream document under RSAB review", 3),
("pub", "Published RFC", 4),
("dead", "Dead editorial stream document", 5),
):
State.objects.create(
type_id="draft-stream-editorial",
slug=slug,
name=name,
order=order,
used=True,
)
State.objects.filter(type_id="draft-stream-editorial", slug="rsab_review").delete()
def reverse(apps, schema_editor):
State = apps.get_model("doc", "State")
StateType = apps.get_model("doc", "StateType")
State.objects.filter(type_id="draft-stream-editorial").delete()
StateType.objects.filter(slug="draft-stream-editorial").delete()
# Intentionally not trying to return broken rsab_review State object
class Migration(migrations.Migration):
dependencies = [
("doc", "0049_add_rsab_doc_positions"),
]
operations = [migrations.RunPython(forward, reverse)]