mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	slack: Store the content-type of realm icons.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							ff90e5355f
						
					
				
				
					commit
					5ae34dc42b
				
			@@ -1339,6 +1339,7 @@ def fetch_team_icons(
 | 
				
			|||||||
            "realm_id": realm_id,
 | 
					            "realm_id": realm_id,
 | 
				
			||||||
            "path": os.path.join(str(realm_id), "icon.original"),
 | 
					            "path": os.path.join(str(realm_id), "icon.original"),
 | 
				
			||||||
            "s3_path": os.path.join(str(realm_id), "icon.original"),
 | 
					            "s3_path": os.path.join(str(realm_id), "icon.original"),
 | 
				
			||||||
 | 
					            "content_type": response.headers["Content-Type"],
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1352,6 +1353,7 @@ def fetch_team_icons(
 | 
				
			|||||||
            "realm_id": realm_id,
 | 
					            "realm_id": realm_id,
 | 
				
			||||||
            "path": os.path.join(str(realm_id), "icon.png"),
 | 
					            "path": os.path.join(str(realm_id), "icon.png"),
 | 
				
			||||||
            "s3_path": os.path.join(str(realm_id), "icon.png"),
 | 
					            "s3_path": os.path.join(str(realm_id), "icon.png"),
 | 
				
			||||||
 | 
					            "content_type": "image/png",
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1317,6 +1317,7 @@ class SlackImporter(ZulipTestCase):
 | 
				
			|||||||
            team_info_fixture["team"],
 | 
					            team_info_fixture["team"],
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
        mock_requests_get.return_value.raw = BytesIO(read_test_image_file("img.png"))
 | 
					        mock_requests_get.return_value.raw = BytesIO(read_test_image_file("img.png"))
 | 
				
			||||||
 | 
					        mock_requests_get.return_value.headers = {"Content-Type": "image/png"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        with self.assertLogs(level="INFO"), self.settings(EXTERNAL_HOST="zulip.example.com"):
 | 
					        with self.assertLogs(level="INFO"), self.settings(EXTERNAL_HOST="zulip.example.com"):
 | 
				
			||||||
            # We need to mock EXTERNAL_HOST to be a valid domain because Slack's importer
 | 
					            # We need to mock EXTERNAL_HOST to be a valid domain because Slack's importer
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user