forked from uncloud/uncloud
Versionise API and cleanups
This commit is contained in:
parent
eea654a9f8
commit
927fb20671
5 changed files with 32 additions and 34 deletions
|
|
@ -825,7 +825,11 @@ class Order(models.Model):
|
|||
|
||||
# Trigger initial bill generation at order creation.
|
||||
def save(self, *args, **kwargs):
|
||||
super(Order, self).save(*args, **kwargs)
|
||||
if self.ending_date and self.ending_date < self.starting_date:
|
||||
raise ValidationError("End date cannot be before starting date")
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
Bill.generate_for(self.starting_date.year, self.starting_date.month, self.owner)
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue