[FIX] dms: use _slugify for subject in directory message_new#492
Merged
OCA-git-bot merged 1 commit intoJun 23, 2026
Merged
Conversation
When an incoming email is processed for a dms.directory alias configured
with "Unpack Emails as: Subdirectory" (alias_process='directory'),
message_new() builds the new subdirectory name from the email subject by
calling ir.http._slug() on a plain string. _slug() expects a record or a
(id, name) tuple, so it raises:
ValueError: too many values to unpack (expected 2)
and the incoming email cannot be ingested. The intent is simply to
slugify the subject string, which is what ir.http._slugify() does.
Use it instead.
Member
|
Next time, put directly the PR with the issue explanation, without the GitHub issue. |
pedrobaeza
approved these changes
Jun 23, 2026
victoralmau
approved these changes
Jun 23, 2026
Member
|
/ocabot merge patch |
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at c8d31ce. Thanks a lot for contributing to OCA. ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #491.
Problem
Incoming emails routed to a
dms.directoryalias configured with Unpack Emails as: Subdirectory (alias_process = 'directory', the default) crash inmessage_new:message_newcallsir.http._slug()on the subject string, but_slug()expects a recordset or a(id, name)tuple, not a plain string.Fix
Use
ir.http._slugify()— the helper meant to slugify a plain string — to build the subdirectory name from the email subject.Test
Verified manually: routing an email (with an attachment) to the directory alias now creates the expected subdirectory, named after the slugified subject, with the attachment stored as a
dms.file. Happy to add an automated regression test underdms/tests/if reviewers prefer.