Commits

Luke Plant committed a251995

Corrected bugs with showing booking problems in admin for already saved objects

  • Participants
  • Parent commits d48d7e5
  • Branches bookings

Comments (0)

Files changed (2)

cciw/bookings/views.py

 
     if 'booking_id' in data:
         booking_obj = Booking.objects.get(id=int(data['booking_id']))
-        form = BookingAdminForm(data, booking_obj)
+        form = BookingAdminForm(data, instance=booking_obj)
     else:
         form = BookingAdminForm(data)
 

templates/admin/bookings/booking/change_form.html

     var getBookingProblems = function() {
         var formData = $('#booking_form').serialize();
 {% if change %}
-        formData = formData + "&booking_id={{ object_id }};";
+        formData = formData + "&booking_id={{ object_id }}";
 {% endif %}
         $.ajax({
             type: "POST",