From 42d03ef54809a56a7c3775adfb30a418af2eb723 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 22 Aug 2020 23:58:08 -0400 Subject: [PATCH] count safe tag correctly in set intersection --- lib/philomena/images/tag_validator.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/philomena/images/tag_validator.ex b/lib/philomena/images/tag_validator.ex index 4328dd1c..6ffafbac 100644 --- a/lib/philomena/images/tag_validator.ex +++ b/lib/philomena/images/tag_validator.ex @@ -74,7 +74,7 @@ defmodule Philomena.Images.TagValidator do defp validate_safe(changeset, %{safe: s, sexual: x, horror: h, gross: g}) do cond do - MapSet.size(s) > 1 and (MapSet.size(x) > 0 or MapSet.size(h) > 0 or MapSet.size(g) > 0) -> + MapSet.size(s) > 0 and (MapSet.size(x) > 0 or MapSet.size(h) > 0 or MapSet.size(g) > 0) -> add_error(changeset, :tag_input, "may not contain any other rating if safe") true ->