From 616d079c5274df174f416220506af3a5847305a7 Mon Sep 17 00:00:00 2001 From: To-om Date: Mon, 1 Mar 2021 16:40:15 +0100 Subject: [PATCH] #1731 Fix taxonomy filter --- thehive/app/org/thp/thehive/services/TaxonomySrv.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thehive/app/org/thp/thehive/services/TaxonomySrv.scala b/thehive/app/org/thp/thehive/services/TaxonomySrv.scala index 0cc0d2f354..89d2a42555 100644 --- a/thehive/app/org/thp/thehive/services/TaxonomySrv.scala +++ b/thehive/app/org/thp/thehive/services/TaxonomySrv.scala @@ -31,10 +31,10 @@ class TaxonomySrv @Inject() (organisationSrv: OrganisationSrv, tagSrv: TagSrv) e richTaxonomy <- Try(RichTaxonomy(taxonomy, tags)) } yield richTaxonomy - def createFreetag(organisation: Organisation with Entity)(implicit graph: Graph, authContext: AuthContext): Try[RichTaxonomy] = { - val customTaxo = Taxonomy(s"_freetags_${organisation._id.value}", "Custom taxonomy", 1) + def createFreetagTaxonomy(organisation: Organisation with Entity)(implicit graph: Graph, authContext: AuthContext): Try[RichTaxonomy] = { + val freetagTaxo = Taxonomy(s"_freetags_${organisation._id.value}", "Custom taxonomy", 1) for { - taxonomy <- createEntity(customTaxo) + taxonomy <- createEntity(freetagTaxo) richTaxonomy <- Try(RichTaxonomy(taxonomy, Seq())) _ <- organisationTaxonomySrv.create(OrganisationTaxonomy(), organisation, taxonomy) } yield richTaxonomy @@ -106,7 +106,7 @@ object TaxonomyOps { noFreetags.filter(_.organisations.get(authContext.organisation)) def noFreetags: Traversal.V[Taxonomy] = - traversal.has(_.namespace, TextP.notStartingWith("_freetags")) + traversal.hasNot(_.namespace, TextP.startingWith("_freetags")) def freetags: Traversal.V[Taxonomy] = traversal.has(_.namespace, TextP.startingWith("_freetags"))