Skip to content

Commit 0197e44

Browse files
feat: add liaison coordinators, remove from restrictions (#9055)
* refactor: clean up outgoing LS from field init * feat: additional LS "from" groups for IETF/IAB Chair+ADs * refactor: reduce queries in get_internal_choices * refactor: break down / rename get_groups_for_person * refactor: inline / remove unneeded methods * refactor: colocate similar field config * refactor: unify role logic for LS To fields * fix: typo * refactor: update EditLiaisonForm to match changes * refactor: update IncomingLiaisonForm to match * fix: typo / add docstring * test: framing for new tests; test_flatten_choices() * test: test_choices_from_group_queryset() * test: test_all_internal_groups() * fix: no person = no internal groups for LS * test: test_all_internal_groups() * test: test_external_groups_for_person() * chore: adjust iab execdir and sdo auth'd individs Need to confirm what is actually needed, but without these users may be able to create/edit LS's they can't actually fill in. * fix: f-string flakes * fix: remove authorized persons from sdo groups * fix: remove liaison_contact and liaison_cc_contact Role objects * feat: liaison coordinators (#8944) * feat: liaison coordinators * fix: give liaison coordinator the ability to send incoming * feat: more flexible liaison stmt "From Contact" (#8958) * refactor: CharField for LS from_contacts * refactor: replace from_contact field * style: copyrights + ruff * fix: listify in the right place * refactor: better validator * refactor: use new from_contact field; fix lint * fix: cleanup * feat: default addresses for roles * chore: update liaisons.resources from_name and to_name were removed in 2015! * fix: improve managing liaison coordinators (#8960) * fix: align liaison coordinator perms with secretariat perms --------- Co-authored-by: Jennifer Richards <[email protected]>
1 parent 32ff440 commit 0197e44

21 files changed

+1194
-168
lines changed

ietf/group/migrations/0005_remove_sdo_authorized_individuals.py

Lines changed: 192 additions & 0 deletions
Large diffs are not rendered by default.

ietf/group/migrations/0006_remove_liason_contacts.py

Lines changed: 270 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright The IETF Trust 2025, All Rights Reserved
2+
3+
from django.db import migrations
4+
5+
6+
def forward(apps, schema_editor):
7+
Group = apps.get_model("group", "Group")
8+
GroupFeatures = apps.get_model("group", "GroupFeatures")
9+
iab = Group.objects.get(acronym="iab")
10+
iab.used_roles = [
11+
"chair",
12+
"delegate",
13+
"exofficio",
14+
"liaison",
15+
"liaison_coordinator",
16+
"member",
17+
]
18+
iab.save()
19+
GroupFeatures.objects.filter(type_id="ietf").update(
20+
default_used_roles=[
21+
"ad",
22+
"member",
23+
"comdir",
24+
"delegate",
25+
"execdir",
26+
"recman",
27+
"secr",
28+
"chair",
29+
]
30+
)
31+
32+
33+
def reverse(apps, schema_editor):
34+
Group = apps.get_model("group", "Group")
35+
iab = Group.objects.get(acronym="iab")
36+
iab.used_roles = []
37+
iab.save()
38+
# Intentionally not putting trac-* back into grouptype ietf default_used_roles
39+
40+
41+
class Migration(migrations.Migration):
42+
dependencies = [
43+
("group", "0006_remove_liason_contacts"),
44+
("name", "0018_alter_rolenames"),
45+
]
46+
47+
operations = [
48+
migrations.RunPython(forward, reverse),
49+
]

ietf/ietfauth/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ def has_role(user, role_names, *args, **kwargs):
137137
group__type="sdo",
138138
group__state="active",
139139
),
140+
"Liaison Coordinator": Q(
141+
name="liaison_coordinator",
142+
group__acronym="iab",
143+
),
140144
"Authorized Individual": Q(
141145
name="auth",
142146
group__type="sdo",

ietf/liaisons/admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class LiaisonStatementAdmin(admin.ModelAdmin):
2424
list_display = ['id', 'title', 'submitted', 'from_groups_short_display', 'purpose', 'related_to']
2525
list_display_links = ['id', 'title']
2626
ordering = ('title', )
27-
raw_id_fields = ('from_contact', 'attachments', 'from_groups', 'to_groups')
27+
raw_id_fields = ('attachments', 'from_groups', 'to_groups')
2828
#filter_horizontal = ('from_groups', 'to_groups')
2929
inlines = [ RelatedLiaisonStatementInline, LiaisonStatementAttachmentInline ]
3030

@@ -50,4 +50,4 @@ class LiaisonStatementEventAdmin(admin.ModelAdmin):
5050
raw_id_fields = ["statement", "by"]
5151

5252
admin.site.register(LiaisonStatement, LiaisonStatementAdmin)
53-
admin.site.register(LiaisonStatementEvent, LiaisonStatementEventAdmin)
53+
admin.site.register(LiaisonStatementEvent, LiaisonStatementEventAdmin)

ietf/liaisons/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Meta:
99
skip_postgeneration_save = True
1010

1111
title = factory.Faker('sentence')
12-
from_contact = factory.SubFactory('ietf.person.factories.EmailFactory')
12+
from_contact = factory.Faker('email')
1313
purpose_id = 'comment'
1414
body = factory.Faker('paragraph')
1515
state_id = 'posted'

0 commit comments

Comments
 (0)