Skip to content

Commit

Permalink
Merge pull request #488 from CaptainFact/staging
Browse files Browse the repository at this point in the history
misc fixes (#487)
  • Loading branch information
Betree authored Jan 24, 2025
2 parents 86a3169 + 1d07248 commit 2733b10
Show file tree
Hide file tree
Showing 2 changed files with 12 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
11 changes: 11 additions & 0 deletions apps/db/lib/db_schema/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,19 @@ 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

defp set_unconfirmed_if_new_email(changeset, _model, _params), do: changeset

@doc """
Generate a changeset to update `reputation` and `today_reputation_gain` without verifying daily limits
"""
Expand Down

0 comments on commit 2733b10

Please sign in to comment.