Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Jan 23, 2025
1 parent 401b211 commit 02ce7e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/cf_jobs/lib/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule CF.Jobs.Application do

# Do not start scheduler in tests
children =
if env == :test,
if env == :test or Application.get_env(:cf, :disable_scheduler),
do: children,
else: children ++ [worker(CF.Jobs.Scheduler, [])]

Expand Down
9 changes: 9 additions & 0 deletions apps/db/lib/db_schema/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ defmodule DB.Schema.User do
|> common_changeset(params)
|> validate_length(:password, min: 6, max: 256)
|> put_encrypted_pw
|> set_unconfirmed_if_new_email(model, params)
end

defp set_unconfirmed_if_new_email(changeset, model, %{"email" => email}) do
if model && !is_nil(email) && email != model.email do
put_change(changeset, :email_confirmed, false)
else
changeset
end
end

@doc """
Expand Down

0 comments on commit 02ce7e2

Please sign in to comment.