Skip to content

Commit 615c69c

Browse files
authored
Merge pull request #63 from aboutcode-org/fix-vulnerablity-model
Use id and repo in Vulnerability unique_together
2 parents 020c7f9 + 2ffe455 commit 615c69c

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

fedcode/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class SearchPackageForm(forms.Form):
109109
label=False,
110110
widget=forms.TextInput(
111111
attrs={
112-
"placeholder": "Please entre a valid purl ex: pkg:maven/org.apache.commons/io@1.3.4",
112+
"placeholder": "Please enter a valid purl ex: pkg:maven/org.apache.commons/io",
113113
"class": "input is-rounded",
114114
"style": "width: 90%;",
115115
},
@@ -123,7 +123,7 @@ class SearchReviewForm(forms.Form):
123123
label=False,
124124
widget=forms.TextInput(
125125
attrs={
126-
"placeholder": "Please Entre a valid Review Name",
126+
"placeholder": "Please Enter a valid Review Name",
127127
"class": "input is-rounded",
128128
"style": "width: 90%;",
129129
},
@@ -137,7 +137,7 @@ class SearchRepositoryForm(forms.Form):
137137
label=False,
138138
widget=forms.TextInput(
139139
attrs={
140-
"placeholder": "Please Entre a Repository URL ex: https://github.com/nexB/vulnerablecode-data",
140+
"placeholder": "Please Enter a Repository URL ex: https://github.com/nexB/vulnerablecode-data",
141141
"class": "input is-rounded",
142142
"style": "width: 90%;",
143143
},
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 5.1.2 on 2024-12-26 09:14
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("fedcode", "0003_remove_package_local_remove_person_local_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AlterUniqueTogether(
14+
name="vulnerability",
15+
unique_together={("id", "repo")},
16+
),
17+
]

fedcode/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ class Vulnerability(models.Model):
604604
)
605605

606606
class Meta:
607-
unique_together = [["repo"]]
607+
unique_together = ('id', 'repo')
608608

609609
@property
610610
def absolute_url(self):

0 commit comments

Comments
 (0)