@@ -133,25 +133,24 @@ class InvoiceController(object):
if user == self.invoice.user:
return True
if user.is_staff:
if self.invoice.user.attendee.access_code == access_code:
return False
def _refresh(self):
''' Refreshes the underlying invoice and cart objects. '''
self.invoice.refresh_from_db()
if self.invoice.cart:
self.invoice.cart.refresh_from_db()
def validate_allowed_to_pay(self):
''' Passes cleanly if we're allowed to pay, otherwise raise
a ValidationError. '''
self._refresh()