fix: 修复创建共享会话链接时 created_by 字段长度问题

pull/8556/head
Jiangjie.Bai 2 years ago committed by Jiangjie.Bai
parent 0f11ca9c37
commit 1b4d389f2b

@ -2,6 +2,7 @@ from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
from orgs.mixins.serializers import OrgResourceModelSerializerMixin
from common.utils.random import random_string
from common.utils.common import pretty_string
from ..models import SessionSharing, SessionJoinRecord
__all__ = ['SessionSharingSerializer', 'SessionJoinRecordSerializer']
@ -33,7 +34,7 @@ class SessionSharingSerializer(OrgResourceModelSerializerMixin):
session = validated_data.get('session')
if session:
validated_data['creator_id'] = session.user_id
validated_data['created_by'] = str(session.user)
validated_data['created_by'] = pretty_string(str(session.user), max_length=32)
validated_data['org_id'] = session.org_id
return super().create(validated_data)

Loading…
Cancel
Save