Skip to content

Commit 562773a

Browse files
committed
Turn Group acronym into a SlugField, make the admin prepopulate the acronym
- Legacy-Id: 4012
1 parent e784dc5 commit 562773a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

ietf/group/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class GroupAdmin(admin.ModelAdmin):
2525
ordering = ["name"]
2626
raw_id_fields = ["charter", "parent", "ad"]
2727
inlines = [RoleInline]
28+
prepopulated_fields = {"acronym": ("name", )}
2829

2930
def role_list(self, obj):
3031
roles = Role.objects.filter(group=obj).order_by("name", "person__name").select_related('person')

ietf/group/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def active_wgs(self):
3434
class Group(GroupInfo):
3535
objects = GroupManager()
3636

37-
acronym = models.CharField(max_length=40, unique=True, db_index=True)
37+
acronym = models.SlugField(max_length=40, unique=True, db_index=True)
3838
charter = models.OneToOneField('doc.Document', related_name='chartered_group', blank=True, null=True)
3939

4040
def latest_event(self, *args, **filter_args):

0 commit comments

Comments
 (0)