@@ -1652,7 +1652,8 @@ def delete(self, *args, **kwargs):
16521652 with suppress (Engagement .DoesNotExist , Product .DoesNotExist ):
16531653 # Suppressing a potential issue created from async delete removing
16541654 # related objects in a separate task
1655- calculate_grade (self .product )
1655+ from dojo .utils import perform_product_grading # noqa: PLC0415 circular import
1656+ perform_product_grading (self .test .engagement .product )
16561657
16571658 def inherit_tags (self , potentially_existing_tags ):
16581659 # get a copy of the tags to be inherited
@@ -2258,9 +2259,8 @@ def delete(self, *args, product_grading_option=True, **kwargs):
22582259 with suppress (Test .DoesNotExist , Engagement .DoesNotExist , Product .DoesNotExist ):
22592260 # Suppressing a potential issue created from async delete removing
22602261 # related objects in a separate task
2261- system_settings = System_Settings .objects .get ()
2262- if system_settings .enable_product_grade :
2263- calculate_grade (self .engagement .product )
2262+ from dojo .utils import perform_product_grading # noqa: PLC0415 circular import
2263+ perform_product_grading (self .test .engagement .product )
22642264
22652265 @property
22662266 def statistics (self ):
@@ -2868,9 +2868,8 @@ def delete(self, *args, product_grading_option=True, **kwargs):
28682868 with suppress (Finding .DoesNotExist , Test .DoesNotExist , Engagement .DoesNotExist , Product .DoesNotExist ):
28692869 # Suppressing a potential issue created from async delete removing
28702870 # related objects in a separate task
2871- system_settings = System_Settings .objects .get ()
2872- if system_settings .enable_product_grade :
2873- calculate_grade (self .test .engagement .product )
2871+ from dojo .utils import perform_product_grading # noqa: PLC0415 circular import
2872+ perform_product_grading (self .test .engagement .product )
28742873
28752874 # only used by bulk risk acceptance api
28762875 @classmethod
@@ -4713,7 +4712,6 @@ def __str__(self):
47134712
47144713
47154714from dojo .utils import ( # noqa: E402 # there is issue due to a circular import
4716- calculate_grade ,
47174715 parse_cvss_data ,
47184716 to_str_typed ,
47194717)
0 commit comments