mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
image: validate sources length
This commit is contained in:
parent
62a2f13bb6
commit
567eaac697
1 changed files with 2 additions and 0 deletions
|
@ -212,11 +212,13 @@ defmodule Philomena.Images.Image do
|
|||
image
|
||||
|> cast(attrs, [])
|
||||
|> SourceDiffer.diff_input(old_sources, new_sources)
|
||||
|> validate_length(:sources, max: 15)
|
||||
end
|
||||
|
||||
def sources_changeset(image, new_sources) do
|
||||
change(image)
|
||||
|> put_assoc(:sources, new_sources)
|
||||
|> validate_length(:sources, max: 15)
|
||||
end
|
||||
|
||||
def tag_changeset(image, attrs, old_tags, new_tags, excluded_tags \\ []) do
|
||||
|
|
Loading…
Reference in a new issue