mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	user_groups: Add deactivated field to NamedUserGroup model.
This commit is contained in:
		@@ -614,7 +614,7 @@ def bulk_create_system_user_groups(groups: list[dict[str, str]], realm: Realm) -
 | 
			
		||||
        user_group_ids = [id for (id,) in cursor.fetchall()]
 | 
			
		||||
 | 
			
		||||
    rows = [
 | 
			
		||||
        SQL("({},{},{},{},{},{},{})").format(
 | 
			
		||||
        SQL("({},{},{},{},{},{},{},{})").format(
 | 
			
		||||
            Literal(user_group_ids[idx]),
 | 
			
		||||
            Literal(realm.id),
 | 
			
		||||
            Literal(group["name"]),
 | 
			
		||||
@@ -622,12 +622,13 @@ def bulk_create_system_user_groups(groups: list[dict[str, str]], realm: Realm) -
 | 
			
		||||
            Literal(True),
 | 
			
		||||
            Literal(initial_group_setting_value),
 | 
			
		||||
            Literal(initial_group_setting_value),
 | 
			
		||||
            Literal(False),
 | 
			
		||||
        )
 | 
			
		||||
        for idx, group in enumerate(groups)
 | 
			
		||||
    ]
 | 
			
		||||
    query = SQL(
 | 
			
		||||
        """
 | 
			
		||||
        INSERT INTO zerver_namedusergroup (usergroup_ptr_id, realm_id, name, description, is_system_group, can_manage_group_id, can_mention_group_id)
 | 
			
		||||
        INSERT INTO zerver_namedusergroup (usergroup_ptr_id, realm_id, name, description, is_system_group, can_manage_group_id, can_mention_group_id, deactivated)
 | 
			
		||||
        VALUES {rows}
 | 
			
		||||
        """
 | 
			
		||||
    ).format(rows=SQL(", ").join(rows))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user