-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
197 additions
and
62 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
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 |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import click | ||
from webapp.app import app | ||
from webapp.models import ( | ||
upsert_numerical_cve_ids, | ||
) | ||
|
||
|
||
@app.cli.command("insert-numerical-cve-ids") | ||
@click.command("insert_numerical_cve_ids") | ||
def insert_numerical_cve_ids(): | ||
"""Management script for the Wiki application.""" | ||
""" | ||
For each cve, update cves.numerical_field with the numerical value | ||
of the CVE id e.g 'CVE-2025-12345' -> 202512345. | ||
""" | ||
|
||
upsert_numerical_cve_ids() | ||
|
||
click.echo("Numerical CVE ids inserted successfully.") | ||
|
||
|
||
def register_commands(app): | ||
"""Register Click commands.""" | ||
# Set up app context | ||
app.app_context().push() | ||
|
||
app.cli.add_command(insert_numerical_cve_ids) |
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.