Skip to content

Commit

Permalink
Create register if has initial data and not id.
Browse files Browse the repository at this point in the history
  • Loading branch information
wsantos committed Aug 11, 2014
1 parent 7779799 commit 1a218a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion motorm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def handle_update_response(response, error):

self.validate()

if self._initial == {}:
if self._initial == {} or (self._initial != {} and
"id" not in self._initial):
_db[self.__collection__].save(
self.serialize(), callback=handle_save_response)
else:
Expand Down

0 comments on commit 1a218a6

Please sign in to comment.