优化:数据更新人为当前更用户id

pull/47/MERGE
李强 2022-04-12 17:29:41 +08:00
parent 44fc7e934a
commit 0f5ca3f3ab
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ class CustomModelSerializer(DynamicFieldsMixin,ModelSerializer):
def update(self, instance, validated_data):
if self.request:
if hasattr(self.instance, self.modifier_field_id):
self.instance.modifier = self.get_request_username()
self.instance[self.modifier_field_id] = self.get_request_user_id()
return super().update(instance, validated_data)
def get_request_username(self):