-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow empty tags #364
Disallow empty tags #364
Conversation
@@ -9,7 +9,9 @@ defmodule Trento.Tags do | |||
|
|||
alias Trento.Repo | |||
|
|||
@spec create_tag(String.t(), Ecto.UUID.t(), String.t()) :: | |||
@type taggable_resource :: :host | :cluster | :sap_system | :database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defp empty?(<<" "::binary, rest::binary>>), do: empty?(rest) | ||
defp empty?(""), do: true | ||
defp empty?(_string), do: false | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what this does? couldn't you check the length of the string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this guy checks for empty and blank strings 😄
a28bfac
to
579578a
Compare
579578a
to
729b841
Compare
729b841
to
e1a809a
Compare
d5898d0
to
c1e7c55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Makes the backend a bit more rebust when creating tags.
Frontend couterpart has not been addressed here.