Skip to content

Commit

Permalink
#1731 Fix taxonomy filter
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 1, 2021
1 parent 1948c63 commit 616d079
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions thehive/app/org/thp/thehive/services/TaxonomySrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 616d079

Please sign in to comment.