API: minor fix
This commit is contained in:
parent
5f53d2ae13
commit
22178c5b23
@ -33,8 +33,10 @@ class Activity(db.Model):
|
|||||||
db.ForeignKey('sports.id'),
|
db.ForeignKey('sports.id'),
|
||||||
nullable=False)
|
nullable=False)
|
||||||
gpx = db.Column(db.String(255), nullable=True)
|
gpx = db.Column(db.String(255), nullable=True)
|
||||||
creation_date = db.Column(db.DateTime, default=datetime.datetime.now)
|
creation_date = db.Column(
|
||||||
modification_date = db.Column(db.DateTime, onupdate=datetime.datetime.now)
|
db.DateTime, default=datetime.datetime.utcnow)
|
||||||
|
modification_date = db.Column(
|
||||||
|
db.DateTime, onupdate=datetime.datetime.utcnow)
|
||||||
activity_date = db.Column(db.DateTime, nullable=False)
|
activity_date = db.Column(db.DateTime, nullable=False)
|
||||||
duration = db.Column(db.Interval, nullable=False)
|
duration = db.Column(db.Interval, nullable=False)
|
||||||
pauses = db.Column(db.Interval, nullable=True)
|
pauses = db.Column(db.Interval, nullable=True)
|
||||||
|
@ -28,7 +28,7 @@ class User(db.Model):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, username, email, password,
|
self, username, email, password,
|
||||||
created_at=datetime.datetime.now()):
|
created_at=datetime.datetime.utcnow()):
|
||||||
self.username = username
|
self.username = username
|
||||||
self.email = email
|
self.email = email
|
||||||
self.password = bcrypt.generate_password_hash(
|
self.password = bcrypt.generate_password_hash(
|
||||||
|
Loading…
Reference in New Issue
Block a user