|
16 | 16 | from dojo.finding.views import prefetch_for_findings |
17 | 17 | from dojo.forms import DeleteFindingGroupForm, EditFindingGroupForm, FindingBulkUpdateForm |
18 | 18 | from dojo.models import Engagement, Finding, Finding_Group, GITHUB_PKey, Product |
19 | | -from dojo.utils import Product_Tab, add_breadcrumb, get_page_items, get_system_setting, get_words_for_field |
| 19 | +from dojo.utils import Product_Tab, add_breadcrumb, get_page_items, get_setting, get_system_setting, get_words_for_field |
20 | 20 |
|
21 | 21 | logger = logging.getLogger(__name__) |
22 | 22 |
|
@@ -121,9 +121,12 @@ def delete_finding_group(request, fgid): |
121 | 121 | extra_tags='alert-success') |
122 | 122 | return HttpResponseRedirect(reverse('view_test', args=(finding_group.test.id,))) |
123 | 123 |
|
124 | | - collector = NestedObjects(using=DEFAULT_DB_ALIAS) |
125 | | - collector.collect([finding_group]) |
126 | | - rels = collector.nested() |
| 124 | + rels = ["Previewing the relationships has been disabled.", ""] |
| 125 | + display_preview = get_setting("DELETE_PREVIEW") |
| 126 | + if display_preview: |
| 127 | + collector = NestedObjects(using=DEFAULT_DB_ALIAS) |
| 128 | + collector.collect([finding_group]) |
| 129 | + rels = collector.nested() |
127 | 130 | product_tab = Product_Tab(finding_group.test.engagement.product, title="Product", tab="settings") |
128 | 131 |
|
129 | 132 | return render(request, 'dojo/delete_finding_group.html', { |
|
0 commit comments