瀏覽代碼

Add “due” logging

master
Pavel Šimerda 8 年之前
父節點
當前提交
73ceae3a3d
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      lib/invoice/db/invoices.py

+ 2
- 0
lib/invoice/db/invoices.py 查看文件

@@ -69,6 +69,7 @@ class InvoiceData(Data):
match = self._date_regex.match(self.date)
if not match:
raise ValueError("Bad date format: {}".format(date))
log.debug("Date match: {0}".format(match.groups()))
return datetime.date(*(int(f) for f in match.groups()))

def _postprocess(self):
@@ -107,6 +108,7 @@ class InvoiceData(Data):
raise ValueError("Bad due format: {}".format(self.due))
else:
due = datetime.timedelta(14)
log.debug("Due: {0}".format(due))
if isinstance(due, datetime.timedelta):
due += date
self._data["date"] = date


Loading…
取消
儲存