stash
This commit is contained in:
parent
373bc7ad40
commit
a2633bff7a
4 changed files with 51 additions and 13 deletions
|
@ -1,3 +1,4 @@
|
|||
from django.utils import timezone
|
||||
from django.db import models
|
||||
from django_softdelete.models import SoftDeleteModel
|
||||
|
||||
|
@ -148,3 +149,10 @@ class ShippingVoucher(models.Model):
|
|||
|
||||
def __str__(self):
|
||||
return self.voucher + ' (' + self.type + ')'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.used_at is None and self.issue_thread is not None:
|
||||
self.used_at = timezone.now()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue