@@ -2595,10 +2595,13 @@ def element_add_organizations(self, item):
2595
2595
organization_ids = item ["organization_ids" ]
2596
2596
if item ["type" ] == "user" :
2597
2597
for organization_id in organization_ids :
2598
- self .opencti .user .add_organization (id = item ["id" ], organization_id = organization_id )
2598
+ self .opencti .user .add_organization (
2599
+ id = item ["id" ], organization_id = organization_id
2600
+ )
2599
2601
else :
2600
2602
raise ValueError (
2601
- "Add organizations operation not compatible with type" , {"type" : item ["type" ]}
2603
+ "Add organizations operation not compatible with type" ,
2604
+ {"type" : item ["type" ]},
2602
2605
)
2603
2606
2604
2607
def element_remove_organizations (self , item ):
@@ -2609,16 +2612,17 @@ def element_remove_organizations(self, item):
2609
2612
organization_ids = item ["organization_ids" ]
2610
2613
if item ["type" ] == "user" :
2611
2614
for organization_id in organization_ids :
2612
- self .opencti .user .delete_organization (id = item ["id" ], organization_id = organization_id )
2615
+ self .opencti .user .delete_organization (
2616
+ id = item ["id" ], organization_id = organization_id
2617
+ )
2613
2618
else :
2614
2619
raise ValueError (
2615
- "Remove organizations operation not compatible with type" , {"type" : item ["type" ]}
2620
+ "Remove organizations operation not compatible with type" ,
2621
+ {"type" : item ["type" ]},
2616
2622
)
2617
2623
2618
2624
def element_add_groups (self , item ):
2619
- group_ids = self .opencti .get_attribute_in_extension (
2620
- "group_ids" , item
2621
- )
2625
+ group_ids = self .opencti .get_attribute_in_extension ("group_ids" , item )
2622
2626
if group_ids is None :
2623
2627
group_ids = item ["group_ids" ]
2624
2628
if item ["type" ] == "user" :
@@ -2630,17 +2634,16 @@ def element_add_groups(self, item):
2630
2634
)
2631
2635
2632
2636
def element_remove_groups (self , item ):
2633
- group_ids = self .opencti .get_attribute_in_extension (
2634
- "group_ids" , item
2635
- )
2637
+ group_ids = self .opencti .get_attribute_in_extension ("group_ids" , item )
2636
2638
if group_ids is None :
2637
2639
group_ids = item ["group_ids" ]
2638
2640
if item ["type" ] == "user" :
2639
2641
for group_id in group_ids :
2640
2642
self .opencti .user .delete_membership (id = item ["id" ], group_id = group_id )
2641
2643
else :
2642
2644
raise ValueError (
2643
- "Remove groups operation not compatible with type" , {"type" : item ["type" ]}
2645
+ "Remove groups operation not compatible with type" ,
2646
+ {"type" : item ["type" ]},
2644
2647
)
2645
2648
2646
2649
def element_operation_delete (self , item , operation ):
0 commit comments