mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-12-23 07:52:23 +00:00
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
|
||||
if self.request.method in ['PUT', 'PATCH']:
|
||||
# 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
|
||||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user