Skip to content

Invitation to manage a domain doesn't succeed if user already exists #859

@Morendil

Description

@Morendil

Bug Report

Problematic behavior
When converting a domain invitation, if the User object already exists, the boolean flag created will have the value False, with the result that the user will not be created in Dimail.

When attempting to manage the domain, user will see the dreaded message Could not retrieve a token, please check 'MAIL_PROVISIONING_API_CREDENTIALS' setting.

Expected behavior/code
The user should be created in Dimail and an allows created; the method should not be a no-op if the user already exists.

Steps to Reproduce
This was seen in production by Denis B, who logged in via ProConnect on Apr 1 at 14:36, was invited by Julien B on Apr 2 at 10:24, and was unable to manage the domain after receiving the invitation.

The production logs are consistent with the hypothesis above: we see the line 2025-04-02 08:24:29,343 mailbox_manager.signals INFO Convert domain invitations for user Denis B but we do not see a line "Invitations converted to domain accesses"… Actually we do not see the confirmation line in the log for any of the other "Convert domain invitations for" lines.

Environment

  • People version: 1.14.1

Possible Solution
Make the body of the if unconditional ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions