-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #899 from TG1999/ref_url_mandatory
Make URLs mandatory for references #891
- Loading branch information
Showing
10 changed files
with
1,217 additions
and
1,178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 4.0.4 on 2022-09-05 12:48 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vulnerabilities', '0019_alter_vulnerabilityreference_options'), | ||
] | ||
|
||
def delete_reference_with_empty_urls(apps, _): | ||
""" | ||
Delete all references with empty URLs. | ||
""" | ||
Reference = apps.get_model("vulnerabilities", "VulnerabilityReference") | ||
Reference.objects.filter(url="").delete() | ||
|
||
operations = [ | ||
migrations.RunPython(delete_reference_with_empty_urls, migrations.RunPython.noop), | ||
] |
18 changes: 18 additions & 0 deletions
18
vulnerabilities/migrations/0021_alter_vulnerabilityreference_url.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.0.4 on 2022-09-05 13:02 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vulnerabilities', '0020_auto_20220905_1248'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='vulnerabilityreference', | ||
name='url', | ||
field=models.URLField(help_text='URL to the vulnerability reference', max_length=1024), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.