diff --git a/lemarche/api/emails/serializers.py b/lemarche/api/emails/serializers.py index 037ed5a03..00e8b3923 100644 --- a/lemarche/api/emails/serializers.py +++ b/lemarche/api/emails/serializers.py @@ -27,8 +27,5 @@ class EmailItemSerializer(serializers.Serializer): Headers = serializers.DictField() -ATTRIBUTES_TO_SAVE_FOR_INBOUND = ["From", "To", "CC", "ReplyTo", "SentAtDate", "Attachments"] - - class EmailsSerializer(serializers.Serializer): items = serializers.ListField(child=EmailItemSerializer()) diff --git a/lemarche/api/emails/views.py b/lemarche/api/emails/views.py index 7d67a1514..e451ddb91 100644 --- a/lemarche/api/emails/views.py +++ b/lemarche/api/emails/views.py @@ -4,7 +4,8 @@ from rest_framework.response import Response from rest_framework.views import APIView -from lemarche.api.emails.serializers import ATTRIBUTES_TO_SAVE_FOR_INBOUND, EmailsSerializer +from lemarche.api.emails.serializers import EmailsSerializer +from lemarche.conversations.constants import ATTRIBUTES_TO_SAVE_FOR_INBOUND from lemarche.conversations.models import Conversation from lemarche.conversations.utils import get_info_from_email_prefix from lemarche.www.conversations.tasks import send_email_from_conversation diff --git a/lemarche/conversations/constants.py b/lemarche/conversations/constants.py new file mode 100644 index 000000000..e56280a17 --- /dev/null +++ b/lemarche/conversations/constants.py @@ -0,0 +1 @@ +ATTRIBUTES_TO_SAVE_FOR_INBOUND = ["From", "To", "CC", "ReplyTo", "SentAtDate", "Attachments"]