瀏覽代碼

Merge pull request #6 from Bounder/master

Fixed calling pre_save in BulkUpdateModelMixin
Miroslav Shubernetskiy 11 年之前
父節點
當前提交
d2343cdb20
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rest_framework_bulk/mixins.py

+ 1 - 1
rest_framework_bulk/mixins.py

@@ -50,7 +50,7 @@ class BulkUpdateModelMixin(object):
 
         if serializer.is_valid():
             try:
-                self.pre_save(serializer.object)
+                [self.pre_save(obj) for obj in serializer.object]
             except ValidationError as err:
                 # full_clean on model instances may be called in pre_save
                 # so we have to handle eventual errors.