Skip to content

Commit dda8ab0

Browse files
authored
Merge pull request #1603 from aboutcode-org/1602-fix-500-api
2 parents e273c67 + 447d1bf commit dda8ab0

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ click==8.1.2
2121
coreapi==2.3.3
2222
coreschema==0.0.4
2323
cryptography==43.0.1
24+
crispy-bootstrap4==2024.1
2425
cwe2==3.0.0
2526
dateparser==1.1.1
2627
decorator==5.1.1
@@ -35,8 +36,8 @@ djangorestframework==3.15.2
3536
doc8==0.11.1
3637
docopt==0.6.2
3738
docutils==0.17.1
38-
drf-spectacular==0.27.2
39-
drf-spectacular-sidecar==2024.7.1
39+
drf-spectacular==0.24.2
40+
drf-spectacular-sidecar==2022.10.1
4041
executing==0.8.3
4142
fetchcode==0.3.0
4243
freezegun==1.2.1

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ install_requires =
6262
django-filter>=24.0
6363
django-widget-tweaks>=1.5.0
6464
django-crispy-forms>=2.3
65+
crispy-bootstrap4>=2024.1
6566
django-environ>=0.11.0
6667
gunicorn>=23.0.0
6768

6869
# for the API doc
69-
drf-spectacular[sidecar]>=0.27.2
70+
drf-spectacular[sidecar]>=0.24.2
7071

7172
#essentials
7273
packageurl-python>=0.15

vulnerabilities/api.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,14 +685,10 @@ def filter_alias(self, queryset, name, value):
685685
return self.queryset.filter(aliases__alias__icontains=alias)
686686

687687

688-
class AliasViewSet(viewsets.ReadOnlyModelViewSet):
688+
class AliasViewSet(VulnerabilityViewSet):
689689
"""
690690
Lookup for vulnerabilities by vulnerability aliases such as a CVE
691691
(https://nvd.nist.gov/general/cve-process).
692692
"""
693693

694-
queryset = Vulnerability.objects.all()
695-
serializer_class = VulnerabilitySerializer
696-
filter_backends = (filters.DjangoFilterBackend,)
697694
filterset_class = AliasFilterSet
698-
throttle_classes = [StaffUserRateThrottle, AnonRateThrottle]

vulnerablecode/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"rest_framework.authtoken",
7979
"widget_tweaks",
8080
"crispy_forms",
81+
"crispy_bootstrap4",
8182
# for API doc
8283
"drf_spectacular",
8384
# required for Django collectstatic discovery
@@ -196,6 +197,7 @@
196197
str(PROJECT_DIR / "static"),
197198
]
198199

200+
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
199201

200202
CRISPY_TEMPLATE_PACK = "bootstrap4"
201203

0 commit comments

Comments
 (0)