extensions-website/files
Anna Sirota b0bb4905b2 Reuse files as previews, icons or featured images (#161)
Now it should be be possible to:

* upload the same image as a preview or featured image on different extensions;
* upload the same image as an icon on different extensions;
* select the same video/image multiple times while adding previews on Draft or Edit page: first one will be saved, the rest of the duplicates will be ignored.

If all extensions referencing the file in any way are deleted, the file remains in the database: no thumbnail generating or scanning will happen if/when the file gets re-uploaded as a preview or featured image.

In all cases of re-upload `File.user` will not change: this shouldn't be a problem because currently there's no code relying on image ownership.

Version files will remain the only exception from this changed behaviour: it will only be possible to re-upload a version file once the version itself is deleted (which also deletes its file).

As a consequence of this change `File.extension_id` is dropped, because it is no longer possible to choose which extension should be saved there.

Should take care of #157

Reviewed-on: #161
Reviewed-by: Oleg-Komarov <oleg-komarov@noreply.localhost>
2024-06-04 12:23:25 +02:00
..
migrations Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
static/files/admin Admin: display icon/featured image/version relations of files 2024-05-31 12:57:19 +02:00
templates/files ApprovalQueue: fix N+1 query checking user.is_moderator 2024-05-06 19:16:50 +02:00
tests Files: add more tests for icon, featured image and video uploads 2024-05-10 18:23:23 +02:00
__init__.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
admin.py Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
apps.py Files: add WebP MIME-type 2024-04-26 13:34:30 +02:00
forms.py Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
models.py Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
signals.py Thumbnails: flag toggling validation requirement 2024-04-26 11:50:55 +02:00
tasks.py Thumbnails: update path when re-generating 2024-05-09 01:39:12 +02:00
theme.xsd Upload files, create extensions of different types + tests 2022-08-31 17:31:22 +02:00
utils.py Support for platforms and wheels (#131) 2024-05-16 18:20:41 +02:00
validators.py Update URLs to latest user manual links 2024-05-22 12:15:12 +02:00