Skip to content

[Task]: Switch icon/preview upload and resize code to use storage class #16060

@diox

Description

@diox

Description

The icon & preview upload code is extremely old and does a bunch of filesystem operations that are dangerous (renaming and removing files) using python os directly.

For safety and consistency, it should use storage classes instead - using a storage class instantiated with TMP_PATH so that it cannot access files outside of this directory (upload_image() does use storage already but it uses the default storage that starts from STORAGE_ROOT so it doesn't offer that kind of protection).

Affected functions:

  • devhub.views.upload_image()
  • addons.tasks.resize_preview()
  • addons.tasks.resize_icon()

Acceptance Criteria

  • devhub.views.upload_image()
  • addons.tasks.resize_preview()
  • addons.tasks.resize_icon()

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions