From 1bed964bb9ce4bb42f7b2fa51b86db3c56e19064 Mon Sep 17 00:00:00 2001 From: elias-boulharts Date: Wed, 6 Sep 2023 14:34:44 +0200 Subject: [PATCH] Cleanup guardian in db --- service_catalog/migrations/0019_auto_20230804_1516.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service_catalog/migrations/0019_auto_20230804_1516.py b/service_catalog/migrations/0019_auto_20230804_1516.py index 406174b05..fa8df5e2e 100644 --- a/service_catalog/migrations/0019_auto_20230804_1516.py +++ b/service_catalog/migrations/0019_auto_20230804_1516.py @@ -6,12 +6,14 @@ deprecated_permission = ["request_operation_on_instance", "request_support_on_instance", "cancel_request", - "comment_request", "approve_request_approvalstep"] + "comment_request"] +deprecated_permission_model = ["billing_group", "teamrolebinding", "userrolebinding"] def remove_deprecated_permissions(apps, schema_editor): Permission = apps.get_model('profiles', 'Permission') Permission.objects.filter(codename__in=deprecated_permission).delete() + Permission.objects.filter(content_type__model__in=deprecated_permission_model).delete() class Migration(migrations.Migration): @@ -23,6 +25,7 @@ class Migration(migrations.Migration): operations = [ migrations.RunSQL("DROP TABLE IF EXISTS guardian_userobjectpermission"), + migrations.RunSQL("DROP TABLE IF EXISTS guardian_groupobjectpermission"), migrations.RunPython(remove_deprecated_permissions), migrations.AlterModelOptions( name='instance',