1 Commits

Author SHA1 Message Date
29d13b5b1f improve oban logging
Some checks failed
continuous-integration/drone/push Build is failing
2023-02-04 20:48:14 -05:00
5 changed files with 6 additions and 15 deletions

View File

@ -44,6 +44,8 @@ config :cannery, Cannery.Repo,
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
socket_options: maybe_ipv6
config :cannery, Cannery.Accounts, registration: System.get_env("REGISTRATION", "invite")
config :cannery, CanneryWeb.Endpoint,
url: [scheme: "https", host: host, port: 443],
http: [
@ -54,10 +56,6 @@ config :cannery, CanneryWeb.Endpoint,
],
server: true
if config_env() in [:dev, :prod] do
config :cannery, Cannery.Accounts, registration: System.get_env("REGISTRATION", "invite")
end
if config_env() == :prod do
# The secret key base is used to sign/encrypt cookies and other secrets.
# A default value is used in config/dev.exs and config/test.exs but you

View File

@ -22,9 +22,6 @@ config :cannery, CanneryWeb.Endpoint,
# In test we don't send emails.
config :cannery, Cannery.Mailer, adapter: Swoosh.Adapters.Test
# Don't require invites for signups
config :cannery, Cannery.Accounts, registration: "public"
# Print only warnings and errors during test
config :logger, level: :warn

View File

@ -117,8 +117,6 @@ defmodule Cannery.Accounts do
:passed
"""
@spec register_user(attrs :: map()) ::
{:ok, User.t()} | {:error, :invalid_token | User.changeset()}
@spec register_user(attrs :: map(), Invite.token() | nil) ::
{:ok, User.t()} | {:error, :invalid_token | User.changeset()}
def register_user(attrs, invite_token \\ nil) do

View File

@ -85,9 +85,7 @@ defmodule Cannery.Accounts.Invites do
end
end
@spec get_invite_by_token(Invite.token() | nil) :: {:ok, Invite.t()} | {:error, :invalid_token}
defp get_invite_by_token(token) when token in [nil, ""], do: {:error, :invalid_token}
@spec get_invite_by_token(Invite.token()) :: {:ok, Invite.t()} | {:error, :invalid_token}
defp get_invite_by_token(token) do
Repo.one(
from i in Invite,

View File

@ -15,11 +15,11 @@ defmodule Cannery.Repo.Migrator do
end
def migrate! do
path = Application.app_dir(:cannery, "priv/repo/migrations")
Ecto.Migrator.run(Cannery.Repo, path, :up, all: true)
path = Application.app_dir(:lokal, "priv/repo/migrations")
Ecto.Migrator.run(Lokal.Repo, path, :up, all: true)
end
defp automigrate_enabled? do
Application.get_env(:cannery, Cannery.Application, automigrate: false)[:automigrate]
Application.get_env(:lokal, Lokal.Application, automigrate: false)[:automigrate]
end
end