def total_cost(self): costs = [] for m in self.models: if isinstance(m, uber.models.Attendee) and getattr(m, 'badges', None): costs.append(c.get_group_price() * int(m.badges)) costs.append(m.amount_extra_unpaid) else: costs.append(m.amount_unpaid) return 100 * sum(costs)
def add_promo_codes(self, session, id, count): group = session.promo_code_group(id) if int(count ) < group.min_badges_addable and not group.is_in_grace_period: raise HTTPRedirect( 'group_promo_codes?id={}&message={}', group.id, 'You must add at least {} codes'.format( group.min_badges_addable)) charge = Charge(group.buyer, amount=100 * int(count) * c.get_group_price(), description='{} extra badge{} for {}'.format( count, 's' if int(count) > 1 else '', group.name)) return {'count': count, 'group': group, 'charge': charge}
def add_promo_codes(self, session, id, count): group = session.promo_code_group(id) if int(count) < group.min_badges_addable and not group.is_in_grace_period: raise HTTPRedirect( 'group_promo_codes?id={}&message={}', group.id, 'You must add at least {} codes'.format(group.min_badges_addable)) charge = Charge( group.buyer, amount=100 * int(count) * c.get_group_price(), description='{} extra badge{} for {}'.format(count, 's' if int(count) > 1 else '', group.name)) return { 'count': count, 'group': group, 'charge': charge }
def new_badge_cost(self): return c.DEALER_BADGE_PRICE if self.is_dealer else c.get_group_price()
def test_group_member(self, clear_price_bumps): assert 30 == c.get_group_price(datetime.now(UTC))