Repository navigation
Conversation
…registration messages - website_event_compassion: new staff-only field profile_picture_original holds the uploaded picture as received (attachment auto-resize skipped), refreshed on each new upload; download button on the registration form. - The "New registration" note to the event responsible and the Muskathlon registration e-mail link the original through the login page. - Unreadable (e.g. HEIC) or oversized pictures are refused with a message naming JPG/PNG instead of the website form's generic error; the upload fields only offer JPG and PNG. - fr/de/it translations, tests in both modules.
The original picture is downloaded as "<participant name>.<jpg|png>" instead of event.registration-<id>-profile_picture_original, from the e-mail links and from the registration form.
Review of #440: profile_picture is no longer resized (field cap and attachment auto-resize), so the staff download it as uploaded and the profile_picture_original fields are dropped. The download link is named after the participant when the message is sent, and is passed to the Muskathlon mail as a render value. Pictures Pillow refuses to open (decompression bomb) get the 'too large' message, and a duplicate skips the upload checks.
[Medium impact] The changes affect participant photo uploads and staff registration notifications. Restrict the public photo response before merging so anonymous visitors cannot retrieve the original upload. Findings
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Participant uploads photo] --> B[Original stored in profile_picture]
B --> C[Staff notification]
C --> D[Login and named download]
B --> E[Public photo route]
E --> F{Dimensions requested?}
F -->|Yes| G[Smaller image]
F -->|No| H[Original photo exposed]
Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/18...." · Reviewed by Greptile |
| # Stored as uploaded, not resized: the staff download it in full quality | ||
| # to print it on fundraising material (T3630). Web pages request a smaller | ||
| # version through /web/image/ or /event/registration/<id>/photo/. | ||
| profile_picture = fields.Image(readonly=False, string="Profile picture") |
There was a problem hiding this comment.
Keeping the original in profile_picture also exposes it through /event/registration/<id>/photo. That public route reads published registrations with sudo() and accepts requests without dimensions. Anyone can now retrieve the full uploaded photo instead of the previously capped copy, including any retained location or other EXIF metadata.
Keep a bounded, metadata-free image for the public route and reserve the original for staff downloads.
How this was verified: The anonymous photo route reads the published registration with sudo() and serves profile_picture without requested dimensions, while this change preserves the original in that field.
There was a problem hiding this comment.
Fixed in e0eb6de, on #440 (this PR is a duplicate of it). Without a size, the public route now serves 1920 px at most, as before this change; resizing also removes the metadata (GPS position, camera). The pages only use sized URLs. Test: a 4000 x 3000 JPG with GPS metadata comes back at 1920 x 1440 without metadata.
|
Thanks for the review. Changes are in 31f1e4e (plus a merge of the latest 18.0):
9 tests pass. PR description updated. |
|
Duplicate of #440, which was closed by mistake and is now reopened. The review and its follow-up are there. |
[T3630] Keep the participant's original photo and link it in the new registration messages
Branch
T3630-participant-original-photoin compassion-website, based onorigin/18.0:1be124d7original photo, download links, clear upload error, testsdcd0947edownload named after the participant31f1e4e4review: keep the uploaded picture itself instead of a second copyaf0ba830merge of the latest 18.0Problem
When someone registers for a Muskathlon or a trip, the profile picture they upload is only stored resized (500 px before, 1920 px since T3266). The file as uploaded is not kept anywhere, so the events team has to ask participants again for an HD version for print material. The "New Muskathlon registration" e-mail lists the registration details but has no way to get the picture.
While testing, two more issues showed up:
base.image_autoresize_max_px).Change
website_event_compassion:profile_pictureis stored as uploaded: no size cap on the field anymore, and it is written without the attachment auto-resize (image_no_postprocess). Web pages are unaffected: they already request resized versions (/web/image/.../1024x1024,/event/registration/<id>/photo/<size>), the shop line image and the partner image keep their own caps.<participant name>.jpg(or.png, from the stored file's type), named when the message is sent./web/login?redirect=...: logged-in staff download directly, logged-out staff log in first (the download alone answers Not Found when logged out).accept), so iPhones convert HEIC photos to JPEG by themselves.muskathlon:fr/de/it translations for all new texts.
Pictures uploaded before this change cannot be recovered: only the resized version was ever stored.
Review of the first version
The first version kept a second field,
profile_picture_original, beside the capped picture. Following the review, it is gone: one picture, stored as uploaded. This also removes the duplicate copy in the filestore, the stored file name, and the case where a duplicated registration got the capped picture as its "original". No migration is needed: the field never reached 18.0 or stage.Not changed from the review:
write()untouched. A test now covers it.acceptin the form builder (registration_form_snippet.esm.js): Odoo 18's website form editor has noacceptoption for file fields, so it would need an override of the core template.Deploy
-u website_event_compassion,muskathlon