mirror of https://gitlab.crans.org/bde/nk20
Do not call setattr with a constant attribute value
This commit is contained in:
parent
952c4383e7
commit
93bc6bb245
|
@ -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…
Reference in New Issue