perf: account cannot be modified (#9585)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-02-16 15:53:45 +08:00
committed by GitHub
parent ef33bc211d
commit b8c872c68e
3 changed files with 5 additions and 12 deletions

View File

@@ -52,6 +52,8 @@ class AccountSerializerCreateValidateMixin:
return instance
def update(self, instance, validated_data):
# account cannot be modified
validated_data.pop('username', None)
push_now = validated_data.pop('push_now', None)
instance = super().update(instance, validated_data)
self.push_account(instance, push_now)