extensions-website/common
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
..
fixtures Merge 'policies' and 'conditions of use' pages (#117) 2024-05-07 19:20:15 +02:00
management/commands Fake data: shorten slugs to avoid dataerrors in psql 2024-05-10 21:07:27 +02:00
middleware Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
static/common Fix: Comment box resize issues in Chromium-based browsers 2024-06-04 10:04:44 +02:00
templates UI: Point "Report Problem" to the "bug" template 2024-05-29 16:00:22 +02:00
templatetags Pagination: Fix URL for next/prev pages 2024-05-22 19:49:26 +02:00
tests Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
views Fix TemplateDoesNotExist that happens during handling of CSRF 2024-04-04 08:49:24 +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
compare.py OpenAPI Support 2024-02-14 15:28:29 +01:00
context_processors.py ApprovalQueue: fix N+1 query checking user.is_moderator 2024-05-06 19:16:50 +02:00
fields.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
help_texts.py Upload files, create extensions of different types + tests 2022-08-31 17:31:22 +02:00
log_entries.py Fix "Cannot record change" error that happens when a new user logs in 2024-04-04 08:41:45 +02:00
markdown_renderers.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
markdown.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
model_mixins.py Record changes: better way to compare object states 2024-04-23 18:38:41 +02:00