From bcc472118944aa421ca51c0c4c815977d756eb95 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Mon, 27 Feb 2023 13:05:24 -0600 Subject: [PATCH] docs(management): update guide to avoid bug --- .../management/commands/group_perms/README.md | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/taccsite_cms/management/commands/group_perms/README.md b/taccsite_cms/management/commands/group_perms/README.md index 76d52c165..3ab2593fd 100644 --- a/taccsite_cms/management/commands/group_perms/README.md +++ b/taccsite_cms/management/commands/group_perms/README.md @@ -12,16 +12,26 @@ You may **either** download an appropriate `.html` from [Django CMS - Developer Use regex to convert the ` + + ``` + + (unminified HTML) + + ```regexp + [\n\s]*\n*[\s]*[\s\w]+ \| [\s\w]+ \| [\s\w]+ ``` - Replace: ```text - group.permissions.add( Permission.objects.get(name='$1') )\n + + model_name = '$2'.lower().replace(' ', '') + content_type = ContentType.objects.get(app_label='$1', model=model_name) + group.permissions.add( Permission.objects.get(name='$3', content_type=content_type) ) ``` ## Program Permissions @@ -29,9 +39,10 @@ Use regex to convert the `