import: Ensure presence of basic avatar images for HipChat.

Our HipChat conversion tool didn't properly handle basic avatar
images, resulting in only the medium-size avatar images being imported
properly.  This fixes that bug by asking the import tool to do the
thumbnailing for the basic avatar image (from the .original file) as
well as the medium avatar image.
This commit is contained in:
Tim Abbott
2018-11-26 17:28:34 -08:00
parent e8f2d6f32b
commit c995e8e2ae
3 changed files with 40 additions and 0 deletions

View File

@@ -633,6 +633,8 @@ def import_uploads(import_dir: Path, processing_avatars: bool=False,
# same realm ID from a previous iteration).
os.remove(medium_file_path)
upload_backend.ensure_medium_avatar_image(user_profile=user_profile)
if record.get("importer_should_thumbnail"):
upload_backend.ensure_basic_avatar_image(user_profile=user_profile)
# Importing data suffers from a difficult ordering problem because of
# models that reference each other circularly. Here is a correct order.