Store and use hash of benefit images
authorMagnus Hagander <magnus@hagander.net>
Wed, 10 Apr 2024 08:13:59 +0000 (10:13 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 15 Apr 2024 17:31:57 +0000 (19:31 +0200)
commita7b2be02d14331b557e102e7937f5992df83a0c8
treec01b00f3b3f0e4a52a73138061d4928b343ac360
parent3851bda95ca2e54e7d3118c920813de4563d584f
Store and use hash of benefit images

Store the hash (md5 is good enough here) of the benefit images, and
maintain it using a trigger. This hash is used to implement
etag-handling for downloads of the image. We don't expect that part to
pay off very well since it's logged in users only, but the hash will be
useful in some upcoming patches, and once we have it implementing the
etag handling is basically free.
postgresqleu/confsponsor/views.py
postgresqleu/util/migrations/0005_storage_hashval.py [new file with mode: 0644]
postgresqleu/util/models.py
postgresqleu/util/storage.py