Commits

Luke Plant committed 41153ad

Used correct value for South Wales transport price on 'add place' page

Comments (0)

Files changed (2)

cciw/bookings/views.py

 from cciw.bookings.forms import EmailForm, AccountDetailsForm, AddPlaceForm
 from cciw.bookings.models import BookingAccount, Price, Booking
 from cciw.bookings.models import PRICE_FULL, PRICE_2ND_CHILD, PRICE_3RD_CHILD, PRICE_CUSTOM, \
-    BOOKING_INFO_COMPLETE, BOOKING_APPROVED, VALUED_PRICE_TYPES
+    BOOKING_INFO_COMPLETE, BOOKING_APPROVED, VALUED_PRICE_TYPES, PRICE_SOUTH_WALES_TRANSPORT
 
 
 # decorators and utilities
 class BookingEditAddBase(DefaultMetaData, TemplateResponseMixin, AjaxyFormMixin):
     template_name = 'cciw/bookings/add_place.html'
     success_url = reverse_lazy('cciw.bookings.views.list_bookings')
-    extra_context = {'booking_open': is_booking_open_thisyear}
+    extra_context = {'booking_open': is_booking_open_thisyear,
+                     'south_wales_surcharge': lambda: Price.objects.get(year=get_thisyear(),
+                                                                        price_type=PRICE_SOUTH_WALES_TRANSPORT).price}
 
     def post(self, request, *args, **kwargs):
         if not is_booking_open_thisyear():

templates/cciw/bookings/add_place.html

 <h2>Transport</h2>
 
 <p>If you require transport from South Wales on the CCIW minibus, please tick
-this box. The cost for this transport is an additional £20.</p>
+this box. The cost for this transport is an additional £{{ south_wales_surcharge }}.</p>
 
 {% cciw_form_field form 'south_wales_transport' 'South Wales transport required' %}
 <br/><br/>