Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Dec 25, 2024
1 parent d89d95d commit 6662995
Show file tree
Hide file tree
Showing 22 changed files with 159 additions and 153 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 26.1.2
elixir 1.16.2-otp-26
erlang 26.2.5.6
elixir 1.18.0-otp-26
105 changes: 41 additions & 64 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,17 @@ case mail_transport do
"smtp" ->
config :claper, Claper.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: smtp_relay,
username: smtp_username,
password: smtp_password,
ssl: smtp_ssl,
relay: "pixel.mxrouting.net",
username: "test@wanadance.com",
password: "Alex1001",
ssl: false,
# always, never, if_available
tls: smtp_tls,
tls: :if_available,
# always, never, if_available
auth: smtp_auth,
port: smtp_port
auth: :always,
port: 587,
retries: 2,
no_mx_lookups: true

config :swoosh, :api_client, false

Expand Down
2 changes: 0 additions & 2 deletions lib/claper/embeds.ex
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ defmodule Claper.Embeds do
|> Repo.update()
end

defp broadcast({:error, _reason} = error, _embed), do: error

defp broadcast({:ok, embed, event_uuid}, event) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
Expand Down
2 changes: 0 additions & 2 deletions lib/claper/events.ex
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,6 @@ defmodule Claper.Events do
ActivityLeader.changeset(activity_leader, attrs)
end

defp broadcast({:error, _reason} = error, _event), do: error

defp broadcast({:ok, e, event_uuid}, event) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
Expand Down
2 changes: 0 additions & 2 deletions lib/claper/forms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ defmodule Claper.Forms do
|> Repo.update()
end

defp broadcast({:error, _reason} = error, _form), do: error

defp broadcast({:ok, form, event_uuid}, event) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
Expand Down
2 changes: 0 additions & 2 deletions lib/claper/polls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ defmodule Claper.Polls do
|> Repo.update()
end

defp broadcast({:error, _reason} = error, _poll), do: error

defp broadcast({:ok, poll, event_uuid}, event) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
Expand Down
2 changes: 0 additions & 2 deletions lib/claper/quizzes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,6 @@ defmodule Claper.Quizzes do
|> Repo.update()
end

defp broadcast({:error, _reason} = error, _quiz), do: error

defp broadcast({:ok, quiz, event_uuid}, event) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
Expand Down
4 changes: 3 additions & 1 deletion lib/claper/quizzes/quiz_question.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ defmodule Claper.Quizzes.QuizQuestion do
use Ecto.Schema
import Ecto.Changeset

import ClaperWeb.Gettext

schema "quiz_questions" do
field :content, :string
field :type, :string, default: "qcm"
Expand Down Expand Up @@ -36,7 +38,7 @@ defmodule Claper.Quizzes.QuizQuestion do
if has_correct_opt do
changeset
else
add_error(changeset, :quiz_question_opts, "must have at least one correct answer")
add_error(changeset, :quiz_question_opts, gettext("must have at least one correct answer"))
end
end
end
2 changes: 1 addition & 1 deletion lib/claper/tasks/converter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ defmodule Claper.Tasks.Converter do
"length" => length,
"status" => "done"
}) do
unless get_presentation_storage() == "local", do: File.rm_rf!(path)
if get_presentation_storage() != "local", do: File.rm_rf!(path)

Phoenix.PubSub.broadcast(
Claper.PubSub,
Expand Down
2 changes: 1 addition & 1 deletion lib/claper_web/live/event_live/event_form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ defmodule ClaperWeb.EventLive.EventFormComponent do

Enum.each(e.leaders, fn leader ->
# Only send email if leader was not present before the update
unless Enum.member?(previous_leaders, leader) do
if !Enum.member?(previous_leaders, leader) do
Claper.Accounts.LeaderNotifier.deliver_event_invitation(
e.name,
leader.email,
Expand Down
6 changes: 0 additions & 6 deletions lib/claper_web/live/event_live/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ defmodule ClaperWeb.EventLive.FormComponent do
{:noreply,
socket
|> assign(:current_form_submit, form_submit)}

{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, :changeset, changeset)}
end
end

Expand All @@ -170,9 +167,6 @@ defmodule ClaperWeb.EventLive.FormComponent do
{:noreply,
socket
|> assign(:current_form_submit, form_submit)}

{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, :changeset, changeset)}
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/lti_13/tool/services/ags.ex
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ defmodule Lti13.Tool.Services.AGS do
|> Map.get(@lti_ags_claim_url, %{})
|> Map.get("lineitems")

unless is_nil(line_items_url) do
if not is_nil(line_items_url) do
%URI{path: line_items_path} = URI.parse(line_items_url)

registration
Expand Down
Loading

0 comments on commit 6662995

Please sign in to comment.