diff --git a/port/views/index.py b/port/views/index.py index 9c665f9..9749175 100644 --- a/port/views/index.py +++ b/port/views/index.py @@ -21,8 +21,9 @@ def new_stay(request): name = request.POST.get('search_name', '') boat_existing = [ (b.id, b.name) for b in \ - Boat.objects.filter(name__icontains=name) ] - pprint(boat_existing) + Boat.objects.filter(name__icontains=name) ] \ + if len(name) > 2 else [] + boat_search_form = BoatSearchForm( name=name, choices=boat_existing)