fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Word change.
[wolnelektury.git]
/
src
/
club
/
models.py
diff --git
a/src/club/models.py
b/src/club/models.py
index
40a4138
..
62c1069
100644
(file)
--- a/
src/club/models.py
+++ b/
src/club/models.py
@@
-205,11
+205,12
@@
class PayUOrder(payu_models.Order):
def status_updated(self):
if self.status == 'COMPLETED':
since = self.schedule.expires_at
def status_updated(self):
if self.status == 'COMPLETED':
since = self.schedule.expires_at
- if since is None or since < self.received_at:
- since = self.received_at
+ n = now()
+ if since is None or since < n:
+ since = n
new_exp = self.schedule.plan.get_next_installment(since)
if self.schedule.payed_at is None:
new_exp = self.schedule.plan.get_next_installment(since)
if self.schedule.payed_at is None:
- self.schedule.payed_at =
self.received_at
+ self.schedule.payed_at =
n
if self.schedule.expires_at is None or self.schedule.expires_at < new_exp:
self.schedule.expires_at = new_exp
self.schedule.save()
if self.schedule.expires_at is None or self.schedule.expires_at < new_exp:
self.schedule.expires_at = new_exp
self.schedule.save()