deposit purchase fix
This commit is contained in:
parent
aa64229f72
commit
1f5f82d08d
|
@ -84,7 +84,8 @@ class Purchase(models.Model):
|
||||||
def create(order, buyable, isDeposit=False):
|
def create(order, buyable, isDeposit=False):
|
||||||
p = Purchase()
|
p = Purchase()
|
||||||
p.order = order
|
p.order = order
|
||||||
if isDeposit:
|
p.isDeposit = isDeposit
|
||||||
|
if p.isDeposit:
|
||||||
p.price = buyable.deposit
|
p.price = buyable.deposit
|
||||||
else:
|
else:
|
||||||
p.price = buyable.price
|
p.price = buyable.price
|
||||||
|
@ -94,7 +95,7 @@ class Purchase(models.Model):
|
||||||
return p
|
return p
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return "%s%s, %s" % (self.buyable.name, self.isDeposit and " (deposit)" or "", self.price)
|
return "%s%s" % (self.buyable.name, (self.isDeposit and " (deposit)" or ""))
|
||||||
|
|
||||||
# def save(self, *args, **kwargs):
|
# def save(self, *args, **kwargs):
|
||||||
# profile = self.user.get_profile()
|
# profile = self.user.get_profile()
|
||||||
|
|
Loading…
Reference in New Issue