Skip to content

Commit 779e4f6

Browse files
chore: resolve upstream conflicts and sync parsers
2 parents 61bcf8e + 102e09a commit 779e4f6

10 files changed

Lines changed: 19 additions & 9 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
0260_github_conf_base_url
2+
0259_locations

dojo/metrics/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ class MetricsType(_MetricsTypeEntry, Enum):
339339
ENDPOINT = ("finding__severity", "mitigated")
340340

341341

342+
<<<<<<< HEAD
342343
def query_counts(
344+
=======
345+
def query_counts[MetricsQuerySet: (QuerySet[Finding], QuerySet[Endpoint_Status])](
346+
>>>>>>> upstream/dev
343347
open_qs: MetricsQuerySet,
344348
active_qs: MetricsQuerySet,
345349
accepted_qs: MetricsQuerySet,

dojo/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,9 @@ def save(self, *args, **kwargs):
10921092
super(Product, product).save()
10931093
# launch the async task to update all finding sla expiration dates
10941094
from dojo.sla_config.helpers import async_update_sla_expiration_dates_sla_config_sync # noqa: I001, PLC0415 circular import
1095-
async_update_sla_expiration_dates_sla_config_sync(self, products, severities=severities)
1095+
from dojo.celery_dispatch import dojo_dispatch_task # noqa: PLC0415 circular import
1096+
1097+
dojo_dispatch_task(async_update_sla_expiration_dates_sla_config_sync, self, products, severities=severities)
10961098

10971099
def clean(self):
10981100
sla_days = [self.critical, self.high, self.medium, self.low]
@@ -1252,7 +1254,9 @@ def save(self, *args, **kwargs):
12521254
super(SLA_Configuration, sla_config).save()
12531255
# launch the async task to update all finding sla expiration dates
12541256
from dojo.sla_config.helpers import async_update_sla_expiration_dates_sla_config_sync # noqa: I001, PLC0415 circular import
1255-
async_update_sla_expiration_dates_sla_config_sync(sla_config, Product.objects.filter(id=self.id))
1257+
from dojo.celery_dispatch import dojo_dispatch_task # noqa: PLC0415 circular import
1258+
1259+
dojo_dispatch_task(async_update_sla_expiration_dates_sla_config_sync, sla_config, Product.objects.filter(id=self.id))
12561260

12571261
def get_absolute_url(self):
12581262
return reverse("view_product", args=[str(self.id)])

dojo/tools/chefinspect/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_description_for_scan_types(self, scan_type):
1515

1616
def convert_score(self, raw_value):
1717
val = float(raw_value)
18-
if val == 0.0:
18+
if val == 0:
1919
return "Info"
2020
if val < 0.4:
2121
return "Low"

dojo/tools/nancy/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def convert_cvss_score(self, raw_value):
3838
if raw_value is None:
3939
return "Info"
4040
val = float(raw_value)
41-
if val == 0.0:
41+
if val == 0:
4242
return "Info"
4343
if val < 4.0:
4444
return "Low"

dojo/tools/nmap/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def convert_cvss_score(self, raw_value):
159159
Critical 9.0-10.0
160160
"""
161161
val = float(raw_value)
162-
if val == 0.0:
162+
if val == 0:
163163
return "Info"
164164
if val < 4.0:
165165
return "Low"

dojo/tools/openvas/parser_v1/xml_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def get_findings(self, filename, test):
7878

7979
def convert_cvss_score(self, raw_value):
8080
val = float(raw_value)
81-
if val == 0.0:
81+
if val == 0:
8282
return "Info"
8383
if val < 4.0:
8484
return "Low"

dojo/tools/ssh_audit/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def convert_cvss_score(self, raw_value):
2626
Critical 9.0-10.0
2727
"""
2828
val = float(raw_value)
29-
if val == 0.0:
29+
if val == 0:
3030
return "Info"
3131
if val < 4.0:
3232
return "Low"

dojo/tools/trivy/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def convert_cvss_score(self, raw_value):
6464
if raw_value is None:
6565
return "Info"
6666
val = float(raw_value)
67-
if val == 0.0:
67+
if val == 0:
6868
return "Info"
6969
if val < 4.0:
7070
return "Low"

requirements-lint.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
ruff==0.15.0
1+
ruff==0.15.0
2+
ruff==0.15.1

0 commit comments

Comments
 (0)