mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +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(:will_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
|
||||
|
||||
defp drop_blank_categories(changeset) do
|
||||
|
@ -72,6 +72,26 @@ defmodule Philomena.Commissions.Commission do
|
|||
]
|
||||
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
|
||||
[
|
||||
"Sketch",
|
||||
|
|
|
@ -17,7 +17,7 @@ defmodule PhilomenaWeb.ModerationLogPlug do
|
|||
def init(opts), do: opts
|
||||
|
||||
@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()]
|
||||
|
||||
@doc false
|
||||
|
|
Loading…
Reference in a new issue