Skip to content

Commit

Permalink
Merge pull request #92 from veeloox/veeloox-datetime_field-patch
Browse files Browse the repository at this point in the history
Update datetime_field.py
  • Loading branch information
heynemann committed Jun 8, 2015
2 parents 7ec9114 + 0ab9a82 commit f07f1b2
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 f07f1b2

Please sign in to comment.