Skip to content

Commit

Permalink
Merge pull request #63 from aboutcode-org/fix-vulnerablity-model
Browse files Browse the repository at this point in the history
Use id and repo in Vulnerability unique_together
  • Loading branch information
keshav-space authored Dec 26, 2024
2 parents 020c7f9 + 2ffe455 commit 615c69c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fedcode/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SearchPackageForm(forms.Form):
label=False,
widget=forms.TextInput(
attrs={
"placeholder": "Please entre a valid purl ex: pkg:maven/org.apache.commons/io@1.3.4",
"placeholder": "Please enter a valid purl ex: pkg:maven/org.apache.commons/io",
"class": "input is-rounded",
"style": "width: 90%;",
},
Expand All @@ -123,7 +123,7 @@ class SearchReviewForm(forms.Form):
label=False,
widget=forms.TextInput(
attrs={
"placeholder": "Please Entre a valid Review Name",
"placeholder": "Please Enter a valid Review Name",
"class": "input is-rounded",
"style": "width: 90%;",
},
Expand All @@ -137,7 +137,7 @@ class SearchRepositoryForm(forms.Form):
label=False,
widget=forms.TextInput(
attrs={
"placeholder": "Please Entre a Repository URL ex: https://github.com/nexB/vulnerablecode-data",
"placeholder": "Please Enter a Repository URL ex: https://github.com/nexB/vulnerablecode-data",
"class": "input is-rounded",
"style": "width: 90%;",
},
Expand Down
17 changes: 17 additions & 0 deletions fedcode/migrations/0004_alter_vulnerability_unique_together.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.1.2 on 2024-12-26 09:14

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("fedcode", "0003_remove_package_local_remove_person_local_and_more"),
]

operations = [
migrations.AlterUniqueTogether(
name="vulnerability",
unique_together={("id", "repo")},
),
]
2 changes: 1 addition & 1 deletion fedcode/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ class Vulnerability(models.Model):
)

class Meta:
unique_together = [["repo"]]
unique_together = ('id', 'repo')

@property
def absolute_url(self):
Expand Down

0 comments on commit 615c69c

Please sign in to comment.