Merge branch 'fix_use_django_tz' of https://github.com/lexqt/mongoengine into 0.8
Conflicts: mongoengine/django/sessions.py Closes #151
This commit is contained in:
commit
b9c9d127a2
5 changed files with 58 additions and 9 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import datetime
|
||||
|
||||
from mongoengine import *
|
||||
|
||||
from django.utils.encoding import smart_str
|
||||
|
|
@ -33,6 +31,7 @@ except ImportError:
|
|||
hash = get_hexdigest(algo, salt, raw_password)
|
||||
return '%s$%s$%s' % (algo, salt, hash)
|
||||
|
||||
from .utils import datetime_now
|
||||
|
||||
REDIRECT_FIELD_NAME = 'next'
|
||||
|
||||
|
|
@ -62,9 +61,9 @@ class User(Document):
|
|||
is_superuser = BooleanField(default=False,
|
||||
verbose_name=_('superuser status'),
|
||||
help_text=_("Designates that this user has all permissions without explicitly assigning them."))
|
||||
last_login = DateTimeField(default=datetime.datetime.now,
|
||||
last_login = DateTimeField(default=datetime_now,
|
||||
verbose_name=_('last login'))
|
||||
date_joined = DateTimeField(default=datetime.datetime.now,
|
||||
date_joined = DateTimeField(default=datetime_now,
|
||||
verbose_name=_('date joined'))
|
||||
|
||||
meta = {
|
||||
|
|
@ -130,7 +129,7 @@ class User(Document):
|
|||
"""Create (and save) a new user with the given username, password and
|
||||
email address.
|
||||
"""
|
||||
now = datetime.datetime.now()
|
||||
now = datetime_now()
|
||||
|
||||
# Normalize the address by lowercasing the domain part of the email
|
||||
# address.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue