Skip to content

Commit

Permalink
new notifications value
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 24, 2016
1 parent 10682b5 commit b30ef09
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/budy/models/order.py
Expand Up @@ -107,13 +107,6 @@ class Order(bundle.Bundle):
safe = True
)

notification_sent = appier.field(
type = bool,
index = True,
initial = False,
safe = True
)

tracking_number = appier.field(
index = True
)
Expand All @@ -127,6 +120,13 @@ class Order(bundle.Bundle):
type = dict
)

notifications = appier.field(
type = list,
index = True,
initial = [],
safe = True
)

lines = appier.field(
type = appier.references(
"OrderLine",
Expand Down Expand Up @@ -383,6 +383,7 @@ def pay_s(
if ensure_waiting: self.ensure_waiting_s()
self.verify_paid()
confirmed = self._pay(payment_data)
self.save()
if vouchers: self.use_vouchers_s()
if confirmed: self.end_pay_s()
if notify: self.notify_s()
Expand Down Expand Up @@ -428,7 +429,8 @@ def notify_s(self, name = None):
)
)
)
self.notification_sent = True
exists = name in self.notifications
if not exists: self.notifications.append(name)
self.save()

@appier.operation(name = "Mark Waiting Payment")
Expand Down

0 comments on commit b30ef09

Please sign in to comment.