fix save method
This commit is contained in:
@@ -69,11 +69,11 @@ class Party(BaseModel):
|
|||||||
elif self.status == 'PURCHASED':
|
elif self.status == 'PURCHASED':
|
||||||
self.process = 75
|
self.process = 75
|
||||||
elif self.status == 'PARTY_IS_MADE':
|
elif self.status == 'PARTY_IS_MADE':
|
||||||
self.process == 100
|
self.process = 100
|
||||||
if self.party_amount and self.party_amount.paid_amount > 0:
|
if hasattr(self, 'party_amount') and self.party_amount.paid_amount > 0:
|
||||||
self.payment_percentage = (self.party_amount.paid_amount / self.party_amount.payment_amount) * 100
|
self.payment_percentage = (self.party_amount.paid_amount / self.party_amount.payment_amount) * 100
|
||||||
self.party_amount.save()
|
self.party_amount.save()
|
||||||
return super().save(args, kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = 'Partiya'
|
verbose_name = 'Partiya'
|
||||||
|
|||||||
Reference in New Issue
Block a user