parent
b588dcf741
commit
16522cae1b
10 changed files with 384 additions and 17 deletions
|
|
@ -81,12 +81,12 @@ class CancelBookingForm(forms.ModelForm):
|
|||
model = BookingOrder
|
||||
fields = ['status']
|
||||
|
||||
def clean(self):
|
||||
booking = self.instance.booking
|
||||
days_to_start = (booking.start_date - datetime.today().date()).days
|
||||
if days_to_start < 7:
|
||||
raise forms.ValidationError("You can't cancel your booking")
|
||||
return self.cleaned_data
|
||||
# def clean(self):
|
||||
# booking = self.instance.booking
|
||||
# days_to_start = (booking.start_date - datetime.today().date()).days
|
||||
# if days_to_start < 7:
|
||||
# raise forms.ValidationError("You can't cancel your booking")
|
||||
# return self.cleaned_data
|
||||
|
||||
|
||||
class BookingDateForm(forms.Form):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue