mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
fix tests (botched typespec & commission listing shenanigans)
This commit is contained in:
parent
c8408376cc
commit
f1b92ac25b
2 changed files with 22 additions and 2 deletions
|
@ -42,7 +42,7 @@ defmodule Philomena.Commissions.Commission do
|
||||||
|> validate_length(:contact, max: 1000, count: :bytes)
|
|> validate_length(:contact, max: 1000, count: :bytes)
|
||||||
|> validate_length(:will_create, max: 1000, count: :bytes)
|
|> validate_length(:will_create, max: 1000, count: :bytes)
|
||||||
|> validate_length(:will_not_create, max: 1000, count: :bytes)
|
|> validate_length(:will_not_create, max: 1000, count: :bytes)
|
||||||
|> validate_subset(:categories, Keyword.values(categories()))
|
|> validate_subset(:categories, category_values())
|
||||||
end
|
end
|
||||||
|
|
||||||
defp drop_blank_categories(changeset) do
|
defp drop_blank_categories(changeset) do
|
||||||
|
@ -72,6 +72,26 @@ defmodule Philomena.Commissions.Commission do
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This is probably not the best way to do this,
|
||||||
|
# but I need dialyzer to shut up and do so fast.
|
||||||
|
def category_values do
|
||||||
|
[
|
||||||
|
"Anthro",
|
||||||
|
"Canon Characters",
|
||||||
|
"Comics",
|
||||||
|
"Fetish Art",
|
||||||
|
"Human and Human-like",
|
||||||
|
"NSFW",
|
||||||
|
"Original Characters",
|
||||||
|
"Original Species",
|
||||||
|
"Non-Humanoid",
|
||||||
|
"Requests",
|
||||||
|
"Safe",
|
||||||
|
"Shipping",
|
||||||
|
"Violence and Gore"
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
def types do
|
def types do
|
||||||
[
|
[
|
||||||
"Sketch",
|
"Sketch",
|
||||||
|
|
|
@ -17,7 +17,7 @@ defmodule PhilomenaWeb.ModerationLogPlug do
|
||||||
def init(opts), do: opts
|
def init(opts), do: opts
|
||||||
|
|
||||||
@type log_details :: %{subject_path: String.t(), body: String.t()}
|
@type log_details :: %{subject_path: String.t(), body: String.t()}
|
||||||
@type details_func :: (Plug.Conn.t(), atom(), any() -> log_details())
|
@type details_func :: (atom(), any() -> log_details())
|
||||||
@type call_opts :: [details: details_func, data: any()]
|
@type call_opts :: [details: details_func, data: any()]
|
||||||
|
|
||||||
@doc false
|
@doc false
|
||||||
|
|
Loading…
Reference in a new issue