优化:数据更新人为当前更用户id
parent
44fc7e934a
commit
0f5ca3f3ab
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue