     user =  User.changeset(%User{}, %{name: name_from_params(params),
                                       family_members: family_members_from_params(params),
                                       primary_language_id: @unknown_language_id,
-                                      facility_id: @hardcoded_facility_id,
+                                      facility_id: facility(conn).id,
                                      })
             |> Repo.insert!()
 

    end
  end


  defp redirect_and_notify(conn, user) do
    conn

  alias OpenPantry.UserCredit
  alias OpenPantry.Facility
  import OpenPantry.Web.UserSelectionView, only: [login_token: 1]
  @unknown_language_id 184

  def index(conn, _params) do
    facility = facility(conn) |> Repo.preload(:users)
    render conn, "index.html",  users: facility.users, conn: conn, changeset: User.changeset(%User{})
  end

