mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	export: Reset settings to default for users not in exportable_user_ids.
These users didn't consent to having their private data exported. Therefore, correct handling of these users should involve scrubbing their settings to just match the realm defaults.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							ceb32a7285
						
					
				
				
					commit
					747e73470e
				
			| @@ -1199,6 +1199,7 @@ def custom_fetch_user_profile(response: TableData, context: Context) -> None: | ||||
|     normal_rows: list[Record] = [] | ||||
|     dummy_rows: list[Record] = [] | ||||
|  | ||||
|     realm_user_default = RealmUserDefault.objects.get(realm=realm) | ||||
|     for row in rows: | ||||
|         if exportable_user_ids is not None: | ||||
|             if row["id"] in exportable_user_ids: | ||||
| @@ -1208,6 +1209,9 @@ def custom_fetch_user_profile(response: TableData, context: Context) -> None: | ||||
|                 # inactive is_mirror_dummy users. | ||||
|                 row["is_mirror_dummy"] = True | ||||
|                 row["is_active"] = False | ||||
|                 for settings_name in RealmUserDefault.property_types: | ||||
|                     value = getattr(realm_user_default, settings_name) | ||||
|                     row[settings_name] = value | ||||
|  | ||||
|         if row["is_mirror_dummy"]: | ||||
|             dummy_rows.append(row) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user