Skip to content

Commit

Permalink
Update datetime_field.py
Browse files Browse the repository at this point in the history
auto_now_on_update return stored date instead of datetime.now()
  • Loading branch information
veeloox committed Jun 8, 2015
1 parent 7ec9114 commit 0ab9a82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions motorengine/fields/datetime_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def get_value(self, value):
if self.auto_now_on_insert and value is None:
return datetime.now()

if self.auto_now_on_update:
return datetime.now()

return value

def to_son(self, value):
if self.auto_now_on_update:
return datetime.now()

if isinstance(value, six.string_types):
return datetime.strptime(value, FORMAT)

Expand Down

0 comments on commit 0ab9a82

Please sign in to comment.