require tag to exist on user link creation

This commit is contained in:
byte[] 2020-09-06 16:23:24 -04:00
parent 93902a19d0
commit cdc142592a
2 changed files with 2 additions and 1 deletions

View file

@ -52,6 +52,7 @@ defmodule Philomena.UserLinks.UserLink do
|> put_assoc(:tag, tag)
|> put_assoc(:user, user)
|> validate_required([:user, :uri, :public])
|> validate_required([:tag], message: "must exist")
|> validate_format(:uri, ~r|\Ahttps?://|)
|> parse_uri()
|> put_verification_code()

View file

@ -14,8 +14,8 @@
| artist:
em artist name here
' 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="]
= error_tag f, :tag
.field
label for="uri"