♻️(backend) refacto email invitation

Remove email invitation from Invitation model
to be able to use it in other context.
We add it in utils.py instead, and it will be called
from the viewset.
We add the document_id to link to the document from
the mail.
This commit is contained in:
Anthony LC
2024-08-15 15:38:38 +02:00
committed by Anthony LC
parent 2391098aba
commit 2f8c5637f4
8 changed files with 143 additions and 123 deletions

View File

@@ -262,7 +262,6 @@ class InvitationSerializer(serializers.ModelSerializer):
"Only owners of a document can invite other users as owners."
)
user.language = request.headers.get("Content-Language", "en")
attrs["document_id"] = document_id
attrs["issuer"] = user
return attrs