Do not call setattr with a constant attribute value
This commit is contained in:
parent
952c4383e7
commit
93bc6bb245
1 changed files with 1 additions and 1 deletions
|
|
@ -74,7 +74,7 @@ class AliasViewSet(ReadProtectedModelViewSet):
|
||||||
serializer_class = self.serializer_class
|
serializer_class = self.serializer_class
|
||||||
if self.request.method in ['PUT', 'PATCH']:
|
if self.request.method in ['PUT', 'PATCH']:
|
||||||
# alias owner cannot be change once establish
|
# alias owner cannot be change once establish
|
||||||
setattr(serializer_class.Meta, 'read_only_fields', ('note',))
|
serializer_class.Meta.read_only_fields = ('note',)
|
||||||
return serializer_class
|
return serializer_class
|
||||||
|
|
||||||
def destroy(self, request, *args, **kwargs):
|
def destroy(self, request, *args, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue