def dashboard(request, name):
    user = get_user(name)
    if (request.method == 'POST'):
        form_region = RegionForm((request.POST or None))
        regions = handle_region_form(form_region, user)
        place_form = PlaceForm((request.POST or None))
        print(place_form)
        handle_place_form(place_form, user)
        search_form = GetTweetsForm((request.POST or None))
        (region, place) = handle_search_form(search_form)
        if (region != ''):
            user.remove_location(region, place)
        user.save_me_to_db()
        user = get_user(name)
        regions = collections.OrderedDict(user.get_regions())
        return render(request, 'dashboard.html', {'name': name, 'regions': regions, 'region_form': RegionForm(), 'place_form': PlaceForm(), 'tweets_form': GetTweetsForm()})
    else:
        user = get_user(name)
        regions = collections.OrderedDict(user.get_regions())
        return render(request, 'dashboard.html', {'name': name, 'regions': regions, 'region_form': RegionForm(), 'place_form': PlaceForm(), 'tweets_form': GetTweetsForm()})
def dashboard(request, name):
    user = get_user(name)
    if (request.method == 'POST'):
        form_region = RegionForm((request.POST or None))
        regions = handle_region_form(form_region, user)
        place_form = PlaceForm((request.POST or None))
        print(place_form)
        handle_place_form(place_form, user)
        search_form = GetTweetsForm((request.POST or None))
        (region, place) = handle_search_form(search_form)
        if (region != ):
            user.remove_location(region, place)
        user.save_me_to_db()
        user = get_user(name)
        regions = collections.OrderedDict(user.get_regions())
        return render(request, 'dashboard.html', {'name': name, 'regions': regions, 'region_form': RegionForm(), 'place_form': PlaceForm(), 'tweets_form': GetTweetsForm()})
    else:
        user = get_user(name)
        regions = collections.OrderedDict(user.get_regions())
        return render(request, 'dashboard.html', {'name': name, 'regions': regions, 'region_form': RegionForm(), 'place_form': PlaceForm(), 'tweets_form': GetTweetsForm()})