mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 03:50:11 +03:00
Fixed regression & added comments.
This commit is contained in:
parent
be129b38fa
commit
ea7b76f943
|
@ -196,13 +196,15 @@ class BaseSerializer(WritableField):
|
|||
self.partial = partial
|
||||
self.many = many
|
||||
|
||||
# Handle allow_add_remove depreaction
|
||||
# Handle allow_add_remove depreaction
|
||||
if hasattr(self, 'allow_add_remove'):
|
||||
# If we already have allow_add_remove, it's a class argument.
|
||||
# By reassigning it we'll trigger the batch_mode configuration
|
||||
warnings.warn('The `allow_add_remove` keyword argument is deprecated. '
|
||||
'Use the `batch_mode` keyword argument instead.',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
self.allow_add_remove = self.allow_add_remove
|
||||
if 'allow_add_remove' in kwargs:
|
||||
if allow_add_remove:
|
||||
warnings.warn('The `allow_add_remove` keyword argument is deprecated. '
|
||||
'Use the `batch_mode` keyword argument instead.',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user