From 43fc457fab65486d5719f722f4b513f3bf96dad7 Mon Sep 17 00:00:00 2001 From: Nat Tuck Date: Wed, 20 Nov 2024 09:43:06 -0500 Subject: [PATCH] latest --- lib/inkfish/itty/server.ex | 2 +- lib/inkfish_web/controllers/sub_controller.ex | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/inkfish/itty/server.ex b/lib/inkfish/itty/server.ex index 61695ba..f61e08c 100644 --- a/lib/inkfish/itty/server.ex +++ b/lib/inkfish/itty/server.ex @@ -96,7 +96,7 @@ defmodule Inkfish.Itty.Server do def send_block(block, %{uuid: uuid, seq: seq, blocks: blocks} = state) do blocks = [block | blocks] - IO.puts(" =[Itty]= Send block for UUID #{uuid} #{block.seq}") + # IO.puts(" =[Itty]= Send block for UUID #{uuid} #{block.seq}") Phoenix.PubSub.broadcast!(Inkfish.PubSub, "ittys:" <> uuid, {:block, uuid, block}) {:noreply, %{state | seq: seq + 1, blocks: blocks}} end diff --git a/lib/inkfish_web/controllers/sub_controller.ex b/lib/inkfish_web/controllers/sub_controller.ex index 4f7702d..04a28e8 100644 --- a/lib/inkfish_web/controllers/sub_controller.ex +++ b/lib/inkfish_web/controllers/sub_controller.ex @@ -49,15 +49,24 @@ defmodule InkfishWeb.SubController do |> Map.put("reg_id", reg.id) |> Map.put("team_id", team.id) + IO.inspect({:sub_params, sub_params}) + case Subs.create_sub(sub_params) do {:ok, sub} -> - GradingTasks.assign_grading_tasks(sub.assignment_id) + IO.inspect({:sub, sub}) + + try do + GradingTasks.assign_grading_tasks(sub.assignment_id) + rescue + ee -> IO.inspect({:assign_grading, ee}) + end conn |> put_flash(:info, "Sub created successfully.") |> redirect(to: Routes.sub_path(conn, :show, sub)) {:error, %Ecto.Changeset{} = changeset} -> + IO.inspect({:error, changeset}) nonce = Base.encode16(:crypto.strong_rand_bytes(32)) token = Phoenix.Token.sign(conn, "upload", %{kind: "sub", nonce: nonce})