def form_valid(self, form):
startDate = form.cleaned_data['<STR_LIT>']<EOL>endDate = form.cleaned_data['<STR_LIT>']<EOL>startTime = form.cleaned_data['<STR_LIT>']<EOL>endTime = form.cleaned_data['<STR_LIT>']<EOL>instructor = form.cleaned_data['<STR_LIT>']<EOL>interval_minutes = getConstant('<STR_LIT>')<EOL>this_date = startDate<EOL>while this_date <= endDate:<EOL><INDENT>this_time = startTime<EOL>while this_time < endTime:<EOL><INDENT>InstructorAvailabilitySlot.objects.create(<EOL>instructor=instructor,<EOL>startTime=ensure_localtime(datetime.combine(this_date, this_time)),<EOL>duration=interval_minutes,<EOL>location=form.cleaned_data.get('<STR_LIT:location>'),<EOL>room=form.cleaned_data.get('<STR_LIT>'),<EOL>pricingTier=form.cleaned_data.get('<STR_LIT>'),<EOL>)<EOL>this_time = (ensure_localtime(datetime.combine(this_date, this_time)) + timedelta(minutes=interval_minutes)).time()<EOL><DEDENT>this_date += timedelta(days=<NUM_LIT:1>)<EOL><DEDENT>return JsonResponse({'<STR_LIT>': True})<EOL>
Create slots and return success message.