chore: Track RFCs if they were tracked as a draft

This commit is contained in:
Jennifer Richards 2023-07-07 17:27:55 -03:00
parent 7d51781f4f
commit 71270621b7
No known key found for this signature in database
GPG key ID: 9B2BF5C5ADDA6A6E

View file

@ -0,0 +1,27 @@
# Generated by Django 4.2.3 on 2023-07-07 18:33
from django.db import migrations
def forward(apps, schema_editor):
"""Track any RFCs that were created from tracked drafts"""
CommunityList = apps.get_model("community", "CommunityList")
RelatedDocument = apps.get_model("doc", "RelatedDocument")
for cl in CommunityList.objects.all():
for rfc in set(
RelatedDocument.objects.filter(
source__in=cl.added_docs.all(),
relationship__slug="became_rfc",
).values_list("target__docs", flat=True)
):
cl.added_docs.add(rfc)
class Migration(migrations.Migration):
dependencies = [
("community", "0002_auto_20230320_1222"),
("doc", "0010_move_rfc_docaliases"),
]
operations = [migrations.RunPython(forward)]