mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Drop unused private save_m2m flag
This commit is contained in:
parent
05c72a5d30
commit
92ae08207a
|
@ -21,6 +21,8 @@ Major version numbers (x.0.0) are reserved for project milestones. No major poi
|
||||||
* Added `PATCH` support.
|
* Added `PATCH` support.
|
||||||
* Added `RetrieveUpdateAPIView`.
|
* Added `RetrieveUpdateAPIView`.
|
||||||
* Relation changes are now persisted in `save` instead of in `.restore_object`.
|
* Relation changes are now persisted in `save` instead of in `.restore_object`.
|
||||||
|
* Cleanup unused internal `save_m2m` flag on `ModelSerializer.save()`.
|
||||||
|
* Relation changes are now persisted in `.save()` instead of in `.restore_object()`.
|
||||||
* Bugfix: Fix issue with FileField validation with files=None.
|
* Bugfix: Fix issue with FileField validation with files=None.
|
||||||
|
|
||||||
### 2.1.14
|
### 2.1.14
|
||||||
|
|
|
@ -530,13 +530,13 @@ class ModelSerializer(Serializer):
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
def save(self, save_m2m=True):
|
def save(self):
|
||||||
"""
|
"""
|
||||||
Save the deserialized object and return it.
|
Save the deserialized object and return it.
|
||||||
"""
|
"""
|
||||||
self.object.save()
|
self.object.save()
|
||||||
|
|
||||||
if getattr(self, 'm2m_data', None) and save_m2m:
|
if getattr(self, 'm2m_data', None):
|
||||||
for accessor_name, object_list in self.m2m_data.items():
|
for accessor_name, object_list in self.m2m_data.items():
|
||||||
setattr(self.object, accessor_name, object_list)
|
setattr(self.object, accessor_name, object_list)
|
||||||
self.m2m_data = {}
|
self.m2m_data = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user