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"))