Changeset - d2d2a1b0ecdd
[Not reviewed]
0 2 0
Christopher Neugebauer - 8 years ago 2016-04-01 05:54:40
chrisjrn@gmail.com
Work for making invoices contain complete profile information
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
registrasion/models.py
Show inline comments
...
 
@@ -59,2 +59,7 @@ class BadgeAndProfile(models.Model):
 

	
 
    def save(self):
 
        if not self.name_per_invoice:
 
            self.name_per_invoice = self.name
 
        super(BadgeAndProfile, self).save()
 

	
 
    attendee = models.OneToOneField(Attendee, on_delete=models.CASCADE)
registrasion/views.py
Show inline comments
...
 
@@ -14,2 +14,3 @@ from django.core.exceptions import ValidationError
 
from django.db import transaction
 
from django.http import Http404
 
from django.shortcuts import redirect
...
 
@@ -337,2 +338,6 @@ def invoice(request, invoice_id):
 
    inv = rego.Invoice.objects.get(pk=invoice_id)
 

	
 
    if request.user != inv.cart.user and not request.user.is_staff:
 
        raise Http404()
 

	
 
    current_invoice = InvoiceController(inv)
...
 
@@ -352,3 +357,2 @@ def pay_invoice(request, invoice_id):
 
    '''
 

	
 
    invoice_id = int(invoice_id)
...
 
@@ -356,3 +360,3 @@ def pay_invoice(request, invoice_id):
 
    current_invoice = InvoiceController(inv)
 
    if not inv.paid and current_invoice.is_valid():
 
    if not current_invoice.invoice.paid and not current_invoice.invoice.void:
 
        current_invoice.pay("Demo invoice payment", inv.value)
0 comments (0 inline, 0 general)