<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def group_selection(request):
 """Allow user to select a TenantGroup if they have more than one."""


    groups = get_user_groups(request.user)
    count = len(groups)
    if count == 1:
        # Redirect to the detail page for this group
        return redirect(groups[0])
    context = {
        'groups': groups,
        'count': count,
    }
    return render(request, 'multitenancy/group-landing.html', context)