mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-20 04:14:23 +01:00
require tag to exist on user link creation
This commit is contained in:
parent
93902a19d0
commit
cdc142592a
2 changed files with 2 additions and 1 deletions
|
@ -52,6 +52,7 @@ defmodule Philomena.UserLinks.UserLink do
|
||||||
|> put_assoc(:tag, tag)
|
|> put_assoc(:tag, tag)
|
||||||
|> put_assoc(:user, user)
|
|> put_assoc(:user, user)
|
||||||
|> validate_required([:user, :uri, :public])
|
|> validate_required([:user, :uri, :public])
|
||||||
|
|> validate_required([:tag], message: "must exist")
|
||||||
|> validate_format(:uri, ~r|\Ahttps?://|)
|
|> validate_format(:uri, ~r|\Ahttps?://|)
|
||||||
|> parse_uri()
|
|> parse_uri()
|
||||||
|> put_verification_code()
|
|> put_verification_code()
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
| artist:
|
| artist:
|
||||||
em artist name here
|
em artist name here
|
||||||
' or a series name
|
' or a series name
|
||||||
p Should be blank only if your content isn't on the site, generally
|
|
||||||
= text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:name", data: [ac: "true", ac_min_length: "3", ac_source: "/tags/autocomplete?term="]
|
= text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:name", data: [ac: "true", ac_min_length: "3", ac_source: "/tags/autocomplete?term="]
|
||||||
|
= error_tag f, :tag
|
||||||
|
|
||||||
.field
|
.field
|
||||||
label for="uri"
|
label for="uri"
|
||||||
|
|
Loading…
Reference in a new issue