groups: Remove id_field_name field from GroupPermissionSetting.

id_field_name was being used only to set the initial dummy
values for realm settings. We can directly add "_id" to the
setting name instead of having an extra id_field_name field.
This commit is contained in:
Sahil Batra
2024-12-03 12:45:23 +05:30
committed by Tim Abbott
parent 121df45cc4
commit 367a0bdbff
12 changed files with 18 additions and 43 deletions

View File

@@ -245,8 +245,8 @@ def do_create_realm(
# For now a dummy value of -1 is given to groups fields which
# is changed later before the transaction is committed.
for permission_configuration in Realm.REALM_PERMISSION_GROUP_SETTINGS.values():
setattr(realm, permission_configuration.id_field_name, -1)
for setting_name in Realm.REALM_PERMISSION_GROUP_SETTINGS:
setattr(realm, setting_name + "_id", -1)
realm.save()