Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions ietf/group/migrations/0007_used_roles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright The IETF Trust 2025, All Rights Reserved

from django.db import migrations


def forward(apps, schema_editor):
Group = apps.get_model("group", "Group")
GroupFeatures = apps.get_model("group", "GroupFeatures")
iab = Group.objects.get(acronym="iab")
iab.used_roles = [
"chair",
"delegate",
"exofficio",
"liaison",
"liaison_coordinator",
"member",
]
iab.save()
GroupFeatures.objects.filter(type_id="ietf").update(
default_used_roles=[
"ad",
"member",
"comdir",
"delegate",
"execdir",
"recman",
"secr",
"chair",
]
)


def reverse(apps, schema_editor):
Group = apps.get_model("group", "Group")
iab = Group.objects.get(acronym="iab")
iab.used_roles = []
iab.save()
# Intentionally not putting trac-* back into grouptype ietf default_used_roles


class Migration(migrations.Migration):
dependencies = [
("group", "0006_remove_liason_contacts"),
("name", "0018_alter_rolenames"),
]

operations = [
migrations.RunPython(forward, reverse),
]
8 changes: 4 additions & 4 deletions ietf/name/fixtures/names.json
Original file line number Diff line number Diff line change
Expand Up @@ -3341,7 +3341,7 @@
"customize_workflow": false,
"default_parent": "",
"default_tab": "ietf.group.views.group_about",
"default_used_roles": "[\n \"ad\",\n \"member\",\n \"comdir\",\n \"delegate\",\n \"execdir\",\n \"recman\",\n \"secr\",\n \"trac-editor\",\n \"trac-admin\",\n \"chair\"\n]",
"default_used_roles": "[\n \"ad\",\n \"member\",\n \"comdir\",\n \"delegate\",\n \"execdir\",\n \"recman\",\n \"secr\",\n \"chair\"\n]",
"docman_roles": "[\n \"chair\"\n]",
"groupman_authroles": "[\n \"Secretariat\"\n]",
"groupman_roles": "[\n \"chair\",\n \"delegate\"\n]",
Expand Down Expand Up @@ -13607,7 +13607,7 @@
"fields": {
"desc": "Coordinates liaison handling for the IAB",
"name": "Liaison Coordinator",
"order": 0,
"order": 14,
"used": true
},
"model": "name.rolename",
Expand Down Expand Up @@ -13698,7 +13698,7 @@
"desc": "Assigned permission TRAC_ADMIN in datatracker-managed Trac Wiki instances",
"name": "Trac Admin",
"order": 0,
"used": true
"used": false
},
"model": "name.rolename",
"pk": "trac-admin"
Expand All @@ -13708,7 +13708,7 @@
"desc": "Provides log-in permission to restricted Trac instances. Used by the generate_apache_perms management command, called from ../../scripts/Cron-runner",
"name": "Trac Editor",
"order": 0,
"used": true
"used": false
},
"model": "name.rolename",
"pk": "trac-editor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ def forward(apps, schema_editor):
defaults={
"name": "Liaison Coordinator",
"desc": "Coordinates liaison handling for the IAB",
"order": 14,
},
)
RoleName.objects.filter(slug__contains="trac-").update(used=False)


def reverse(apps, schema_editor):
Expand All @@ -23,6 +25,7 @@ def reverse(apps, schema_editor):
used=True
)
RoleName.objects.filter(slug="liaison_coordinator").delete()
# Intentionally not restoring trac-* RoleNames to used=True


class Migration(migrations.Migration):
Expand Down