fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfix
[wolnelektury.git]
/
src
/
club
/
payu
/
models.py
diff --git
a/src/club/payu/models.py
b/src/club/payu/models.py
index
f7c3535
..
5764f88
100644
(file)
--- a/
src/club/payu/models.py
+++ b/
src/club/payu/models.py
@@
-7,6
+7,7
@@
from urllib.request import HTTPError
from django.contrib.sites.models import Site
from django.db import models
from django.urls import reverse
from django.contrib.sites.models import Site
from django.db import models
from django.urls import reverse
+from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from . import POSS
from django.utils.translation import ugettext_lazy as _
from . import POSS
@@
-36,6
+37,7
@@
class Order(models.Model):
('CANCELED', _('Canceled')),
('REJECTED', _('Rejected')),
])
('CANCELED', _('Canceled')),
('REJECTED', _('Rejected')),
])
+ completed_at = models.DateTimeField(null=True, blank=True)
class Meta:
abstract = True
class Meta:
abstract = True
@@
-150,5
+152,7
@@
class Notification(models.Model):
status = self.get_status()
if self.order.status not in (status, 'COMPLETED'):
self.order.status = status
status = self.get_status()
if self.order.status not in (status, 'COMPLETED'):
self.order.status = status
+ if status == 'COMPLETED':
+ self.order.completed_at = now()
self.order.save()
self.order.status_updated()
self.order.save()
self.order.status_updated()