Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
  • Loading branch information
TG1999 committed Aug 23, 2024
1 parent 0178500 commit 21ec05c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions vulnerabilities/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

from urllib.parse import unquote

from cvss.exceptions import CVSS2MalformedError
from cvss.exceptions import CVSS3MalformedError
from cvss.exceptions import CVSS4MalformedError
from django.db.models import Prefetch
from django_filters import rest_framework as filters
from drf_spectacular.utils import extend_schema
Expand All @@ -31,12 +34,10 @@
from vulnerabilities.models import VulnerabilitySeverity
from vulnerabilities.models import Weakness
from vulnerabilities.models import get_purl_query_lookups
from vulnerabilities.severity_systems import EPSS, SCORING_SYSTEMS
from vulnerabilities.severity_systems import EPSS
from vulnerabilities.severity_systems import SCORING_SYSTEMS
from vulnerabilities.throttling import StaffUserRateThrottle
from vulnerabilities.utils import get_severity_range
from cvss.exceptions import CVSS2MalformedError
from cvss.exceptions import CVSS3MalformedError
from cvss.exceptions import CVSS4MalformedError


class VulnerabilitySeveritySerializer(serializers.ModelSerializer):
Expand Down Expand Up @@ -197,7 +198,7 @@ class VulnerabilitySerializer(BaseResourceSerializer):
aliases = AliasSerializer(many=True, source="alias")
kev = KEVSerializer(read_only=True)
weaknesses = WeaknessSerializer(many=True)
severity_range_score = serializers.SerializerMethodField()
severity_range_score = serializers.SerializerMethodField()

def to_representation(self, instance):
data = super().to_representation(instance)
Expand All @@ -210,7 +211,7 @@ def to_representation(self, instance):
data.pop("kev")

return data

def get_severity_range_score(self, instance):
severity_vectors = []
severity_values = set()
Expand Down

0 comments on commit 21ec05c

Please sign in to comment.