Commits

Ian George committed 59c6402

Changed admin lists and stopped payment_made registering multiple payments with the same details

Comments (0)

Files changed (2)

quiet/shop/admin.py

 class OrderAdmin(admin.ModelAdmin):
     model=Order
     inlines = [OrderItemInline, OrderStatusInline, OrderPaymentInline, OrderAddressInline]
-    list_display=['order_ref', 'balance', 'total']
+    list_display=['order_ref', 'balance', 'total', 'complete',]
     exclude=('tax', 'deposit', 'discount', 'tax_rate')
 
 admin.site.register(Order, OrderAdmin)

quiet/shop/models/order.py

         
     debug("payment", "Order:%s" % ordr)
 
-    op = OrderPayment(order=ordr, reference=kwargs['reference'], source=kwargs['source'], amount=kwargs['amount'])
+    op = OrderPayment.objects.get_or_create(order=ordr, reference=kwargs['reference'], source=kwargs['source'], amount=kwargs['amount'])
     op.save()
 
     if ordr.status.count() == 0: