[18.0] mail_drop_target: uploading a file to a Discuss channel fails (_get_as_sudo_from_request_or_raise no longer exists)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read mail_drop_target/controllers/discuss.py, especially mail_attachment_upload_email() around lines 31–35, and compare its channel access check with the 18.0 upload controller’s _get_thread_with_access() approach. Run core mail tests TestToggleUpload.test_upload_allowed and test_upload_denied with this module installed; done means direct channel uploads succeed and .eml/.msg imports continue to work.
Written by the indexing model from the issue text.
Description
Module: mail_drop_target (18.0)
Steps to reproduce
- Install
mail_drop_target. - Upload a file to a Discuss channel through
/mail/attachment/uploadwithoutis_pending(a file attached directly to the thread). Core testmailTestToggleUploaddoes this, and so does any client posting a file to a channel.
Actual
AttributeError: 'discuss.channel.member' object has no attribute '_get_as_sudo_from_request_or_raise'
File ".../mail_drop_target/controllers/discuss.py", line 20, in mail_attachment_upload
File ".../mail_drop_target/controllers/discuss.py", line 33, in mail_attachment_upload_email
The upload fails with a server error. Core TestToggleUpload.test_upload_allowed and test_upload_denied fail with this module installed.
Expected
The file is uploaded, or the email is imported when it is an .eml/.msg file, as on other threads.
Cause
mail_attachment_upload_email() (controllers/discuss.py:31-35) gets the channel member with discuss.channel.member._get_as_sudo_from_request_or_raise(). That helper existed in 17.0 but not in 18.0, where the upload controller checks the access with _get_thread_with_access().
- Dominant language
- Python
- Stars
- 36
- Forks
- 180
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 14
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OCA/mail
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Activity creation without model_idPossibly taken @parabol123654 claimed this 4 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
add entry to blockOpen
Difficulty 1/5 Under an hour Newbie friendliness 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Possibly taken @0z5a claimed this today. Openneeds-triage
Difficulty 2/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
future-agi/future-agi#4092 · 1 comment ·
Maintainers usually reply within 1 day
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeOpen
Difficulty 1/5 Under an hour Newbie friendliness 82/100
WingedGuardian/GENesis-AGI#4641 ·
Maintainers usually reply within 1 day