From 5b43cd763efdf40944f7b8fab3da4783a75dff52 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 26 Sep 2015 15:38:57 +0200 Subject: [PATCH] Fix default for Operation. --- accountant/api/models/operations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accountant/api/models/operations.py b/accountant/api/models/operations.py index b26eaee..fa53a72 100644 --- a/accountant/api/models/operations.py +++ b/accountant/api/models/operations.py @@ -14,6 +14,8 @@ You should have received a copy of the GNU Affero General Public License along with Accountant. If not, see . """ +from datetime import date + import arrow from sqlalchemy import func, case, desc, true, false, text @@ -28,7 +30,7 @@ class Operation(db.Model): operation_date = db.Column( db.Date, nullable=False, - default=arrow.now().date(), + default=date.today, server_default=func.current_date(), index=True )