🌐(backend) user language from request Content-Language
We want to adapt the email language depend the website choosen language. We get the website language from the request Content-Language header. We adapt the serializer to set the user language from the request Content-Language header. Thanks to that our email will be in the right language.
This commit is contained in:
@@ -262,6 +262,7 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user