Manual merge of ungleich/master into opennebula-integration

This commit is contained in:
M.Ravi 2017-04-24 03:01:05 +05:30
commit d537fcb118
227 changed files with 25686 additions and 482 deletions

View file

@ -123,9 +123,11 @@ class BookingDateForm(forms.Form):
raise forms.ValidationError("Your end date must be greather than your start date.")
q1 = Q(bookingorder__customer__user=self.user,
start_date__lte=start_date, end_date__gte=start_date)
start_date__lte=start_date, end_date__gte=start_date,
bookingorder__status=BookingOrder.APPROVED)
q2 = Q(bookingorder__customer__user=self.user,
start_date__gt=start_date, start_date__lte=end_date)
start_date__gt=start_date, start_date__lte=end_date,
bookingorder__status=BookingOrder.APPROVED)
if Booking.objects.filter(q1 | q2).exists():
raise forms.ValidationError("You already have a booking in these dates.")