Skip to content

Commit 7b93709

Browse files
committed
Tweaked the greate_group_wikis management command to accept trailing fileglob wildcards on adhoc wiki group acronyms. Added a generic NomCom wiki to the list of adhoc wikis to be created and maintained, with admins from active nomcom* groups.
- Legacy-Id: 16176
1 parent 8d9c601 commit 7b93709

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

ietf/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,10 @@ def skip_unreadable_post(record):
935935
TRAC_CREATE_GROUP_STATES = ['bof', 'active', ]
936936
TRAC_CREATE_GROUP_ACRONYMS = ['iesg', 'iaoc', 'ietf', ]
937937
TRAC_CREATE_ADHOC_WIKIS = [
938-
# admin group, name, sub-path
938+
# admin group acronym, name, sub-path
939+
# A trailing fileglob wildcard is supported on group acronyms
939940
('iesg', 'Meeting', "ietf/meeting"),
941+
('nomcom*', 'NomCom', 'nomcom'),
940942
]
941943

942944
SVN_PACKAGES = [

ietf/utils/management/commands/create_group_wikis.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ def create_group_trac(self, group):
232232

233233
def update_trac_permissions(self, name, group, env):
234234
if self.dummy_run:
235-
self.note("Would update Trac permissions for '%s'" % name)
235+
self.note("Would update Trac permissions for '%s' from group %s" % (name, group.acronym))
236236
else:
237-
self.note("Updating Trac permissions for '%s'" % name)
237+
self.note("Updating Trac permissions for '%s' from group %s" % (name, group.acronym))
238238
mgr = PermissionSystem(env)
239239
permission_list = mgr.get_all_permissions()
240240
permission_list = [ (u,a) for (u,a) in permission_list if not u in ['anonymous', 'authenticated']]
@@ -392,8 +392,13 @@ def handle(self, *filenames, **options):
392392
if not trac_env and not self.dummy_run:
393393
continue
394394

395-
group = Group.objects.get(acronym=acronym)
396-
self.update_trac_permissions(name, group, trac_env)
395+
if acronym.endswith('*'):
396+
groups = Group.objects.filter(acronym__startswith=acronym[:-1], state_id='active')
397+
for group in groups:
398+
self.update_trac_permissions(name, group, trac_env)
399+
else:
400+
group = Group.objects.get(acronym=acronym)
401+
self.update_trac_permissions(name, group, trac_env)
397402

398403
except Exception as e:
399404
self.errors.append(e)

0 commit comments

Comments
 (0)