Skip to content

Commit 9985255

Browse files
Maffoochclaude
andcommitted
fix: ruff F401 + drop stub_finding refs from fixtures
- dojo/finding/views.py: drop now-unused `json` and `formats` imports (the only callers were in the deleted stub-finding views). - tests/test_test.py: drop the now-unused `on_exception_html_source_logger` import. - Remove dojo.stub_finding rows and watson.searchentry rows pointing at that content type from all four data fixtures so loaddata stops faulting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dfbd7c0 commit 9985255

6 files changed

Lines changed: 73 additions & 626 deletions

File tree

dojo/finding/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import base64
33
import contextlib
44
import copy
5-
import json
65
import logging
76
import mimetypes
87
from collections import OrderedDict, defaultdict
@@ -21,7 +20,7 @@
2120
from django.http import Http404, HttpRequest, HttpResponse, HttpResponseRedirect, JsonResponse, StreamingHttpResponse
2221
from django.shortcuts import get_object_or_404, render
2322
from django.urls import reverse
24-
from django.utils import formats, timezone
23+
from django.utils import timezone
2524
from django.utils.safestring import mark_safe
2625
from django.utils.translation import gettext as _
2726
from django.views import View

dojo/fixtures/defect_dojo_sample_data.json

Lines changed: 0 additions & 240 deletions
Original file line numberDiff line numberDiff line change
@@ -32179,48 +32179,6 @@
3217932179
"model": "dojo.finding",
3218032180
"pk": 347
3218132181
},
32182-
{
32183-
"fields": {
32184-
"date": "2025-03-10",
32185-
"description": "test stub finding",
32186-
"reporter": [
32187-
"admin"
32188-
],
32189-
"severity": "High",
32190-
"test": 3,
32191-
"title": "test stub finding 1"
32192-
},
32193-
"model": "dojo.stub_finding",
32194-
"pk": 2
32195-
},
32196-
{
32197-
"fields": {
32198-
"date": "2025-03-10",
32199-
"description": "test stub finding",
32200-
"reporter": [
32201-
"admin"
32202-
],
32203-
"severity": "High",
32204-
"test": 14,
32205-
"title": "test stub finding 2"
32206-
},
32207-
"model": "dojo.stub_finding",
32208-
"pk": 3
32209-
},
32210-
{
32211-
"fields": {
32212-
"date": "2025-03-10",
32213-
"description": "test stub finding",
32214-
"reporter": [
32215-
"admin"
32216-
],
32217-
"severity": "High",
32218-
"test": 13,
32219-
"title": "test stub finding 3"
32220-
},
32221-
"model": "dojo.stub_finding",
32222-
"pk": 4
32223-
},
3222432182
{
3222532183
"fields": {
3222632184
"cve": null,
@@ -43260,96 +43218,6 @@
4326043218
"model": "watson.searchentry",
4326143219
"pk": 6
4326243220
},
43263-
{
43264-
"fields": {
43265-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43266-
"content_type": [
43267-
"dojo",
43268-
"stub_finding"
43269-
],
43270-
"description": "",
43271-
"engine_slug": "default",
43272-
"meta_encoded": "{}",
43273-
"object_id": "2",
43274-
"object_id_int": 2,
43275-
"title": "High Impact test finding",
43276-
"url": ""
43277-
},
43278-
"model": "watson.searchentry",
43279-
"pk": 7
43280-
},
43281-
{
43282-
"fields": {
43283-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43284-
"content_type": [
43285-
"dojo",
43286-
"stub_finding"
43287-
],
43288-
"description": "",
43289-
"engine_slug": "default",
43290-
"meta_encoded": "{}",
43291-
"object_id": "3",
43292-
"object_id_int": 3,
43293-
"title": "High Impact test finding",
43294-
"url": ""
43295-
},
43296-
"model": "watson.searchentry",
43297-
"pk": 8
43298-
},
43299-
{
43300-
"fields": {
43301-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43302-
"content_type": [
43303-
"dojo",
43304-
"stub_finding"
43305-
],
43306-
"description": "",
43307-
"engine_slug": "default",
43308-
"meta_encoded": "{}",
43309-
"object_id": "4",
43310-
"object_id_int": 4,
43311-
"title": "High Impact test finding",
43312-
"url": ""
43313-
},
43314-
"model": "watson.searchentry",
43315-
"pk": 9
43316-
},
43317-
{
43318-
"fields": {
43319-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43320-
"content_type": [
43321-
"dojo",
43322-
"stub_finding"
43323-
],
43324-
"description": "",
43325-
"engine_slug": "default",
43326-
"meta_encoded": "{}",
43327-
"object_id": "5",
43328-
"object_id_int": 5,
43329-
"title": "High Impact test finding",
43330-
"url": ""
43331-
},
43332-
"model": "watson.searchentry",
43333-
"pk": 10
43334-
},
43335-
{
43336-
"fields": {
43337-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43338-
"content_type": [
43339-
"dojo",
43340-
"stub_finding"
43341-
],
43342-
"description": "",
43343-
"engine_slug": "default",
43344-
"meta_encoded": "{}",
43345-
"object_id": "6",
43346-
"object_id_int": 6,
43347-
"title": "High Impact test finding",
43348-
"url": ""
43349-
},
43350-
"model": "watson.searchentry",
43351-
"pk": 11
43352-
},
4335343221
{
4335443222
"fields": {
4335543223
"content": "",
@@ -43656,114 +43524,6 @@
4365643524
"model": "watson.searchentry",
4365743525
"pk": 28
4365843526
},
43659-
{
43660-
"fields": {
43661-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43662-
"content_type": [
43663-
"dojo",
43664-
"stub_finding"
43665-
],
43666-
"description": "",
43667-
"engine_slug": "default",
43668-
"meta_encoded": "{}",
43669-
"object_id": "2",
43670-
"object_id_int": 2,
43671-
"title": "High Impact test finding",
43672-
"url": ""
43673-
},
43674-
"model": "watson.searchentry",
43675-
"pk": 29
43676-
},
43677-
{
43678-
"fields": {
43679-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43680-
"content_type": [
43681-
"dojo",
43682-
"stub_finding"
43683-
],
43684-
"description": "",
43685-
"engine_slug": "default",
43686-
"meta_encoded": "{}",
43687-
"object_id": "3",
43688-
"object_id_int": 3,
43689-
"title": "High Impact test finding",
43690-
"url": ""
43691-
},
43692-
"model": "watson.searchentry",
43693-
"pk": 30
43694-
},
43695-
{
43696-
"fields": {
43697-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43698-
"content_type": [
43699-
"dojo",
43700-
"stub_finding"
43701-
],
43702-
"description": "",
43703-
"engine_slug": "default",
43704-
"meta_encoded": "{}",
43705-
"object_id": "4",
43706-
"object_id_int": 4,
43707-
"title": "High Impact test finding",
43708-
"url": ""
43709-
},
43710-
"model": "watson.searchentry",
43711-
"pk": 31
43712-
},
43713-
{
43714-
"fields": {
43715-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43716-
"content_type": [
43717-
"dojo",
43718-
"stub_finding"
43719-
],
43720-
"description": "",
43721-
"engine_slug": "default",
43722-
"meta_encoded": "{}",
43723-
"object_id": "5",
43724-
"object_id_int": 5,
43725-
"title": "High Impact test finding",
43726-
"url": ""
43727-
},
43728-
"model": "watson.searchentry",
43729-
"pk": 32
43730-
},
43731-
{
43732-
"fields": {
43733-
"content": "High Impact test finding None HIGH test finding test mitigation HIGH S0 None None None None None 5b0dead640b58a2b778aa2e8f5cccf67df7dc833b0c3f410985d1237615c86e7 ",
43734-
"content_type": [
43735-
"dojo",
43736-
"stub_finding"
43737-
],
43738-
"description": "",
43739-
"engine_slug": "default",
43740-
"meta_encoded": "{}",
43741-
"object_id": "6",
43742-
"object_id_int": 6,
43743-
"title": "High Impact test finding",
43744-
"url": ""
43745-
},
43746-
"model": "watson.searchentry",
43747-
"pk": 33
43748-
},
43749-
{
43750-
"fields": {
43751-
"content": "DUMMY FINDING http://www.example.com HIGH TEST finding MITIGATION HIGH S0 None None None None None c89d25e445b088ba339908f68e15e3177b78d22f3039d1bfea51c4be251bf4e0 ",
43752-
"content_type": [
43753-
"dojo",
43754-
"stub_finding"
43755-
],
43756-
"description": "",
43757-
"engine_slug": "default",
43758-
"meta_encoded": "{}",
43759-
"object_id": "7",
43760-
"object_id_int": 7,
43761-
"title": "DUMMY FINDING",
43762-
"url": ""
43763-
},
43764-
"model": "watson.searchentry",
43765-
"pk": 34
43766-
},
4376743527
{
4376843528
"fields": {
4376943529
"content": "April Monthly Engagement Requested by the team for regular manual checkup by the security team. None None None Completed threat_model none none Interactive None None None None",

0 commit comments

Comments
 (0)