use author of ModelInstanceWrapper if not missing in save or delete call
This commit is contained in:
parent
b062e76b7a
commit
4e1469c7d4
1 changed files with 4 additions and 0 deletions
|
@ -110,6 +110,8 @@ class ModelInstanceWrapper(BaseWrapper):
|
|||
raise TypeError
|
||||
|
||||
def save(self, author=None):
|
||||
if author is None:
|
||||
author = self._author
|
||||
if self.pk is None:
|
||||
self._changeset.add_create(self, author=author)
|
||||
for field, initial_value in self._initial_values.items():
|
||||
|
@ -132,6 +134,8 @@ class ModelInstanceWrapper(BaseWrapper):
|
|||
self._changeset.add_update(self, name=field.name, value=new_value, author=author)
|
||||
|
||||
def delete(self, author=None):
|
||||
if author is None:
|
||||
author = self._author
|
||||
self._changeset.add_delete(self, author=author)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue