perf: 优化 gateway 返回情况

This commit is contained in:
ibuler
2023-02-16 16:51:42 +08:00
parent 726f90ab16
commit a63709002d
4 changed files with 13 additions and 12 deletions

View File

@@ -12,19 +12,19 @@ from .base import BaseAccountSerializer
class AccountSerializerCreateValidateMixin:
id: str
from_id: str
template: bool
push_now: bool
replace_attrs: callable
def to_internal_value(self, data):
_id = data.pop('id', None)
from_id = data.pop('id', None)
ret = super().to_internal_value(data)
self.id = _id
self.from_id = from_id
return ret
def set_secret(self, attrs):
_id = self.id
_id = self.from_id
template = attrs.pop('template', None)
if _id and template: