Skip to content

Commit 1a78756

Browse files
authored
Add pagination to valid versions improver (#1307)
* Add pagination to valid versions improver Signed-off-by: Tushar Goel <[email protected]> * Fix formatting Signed-off-by: Tushar Goel <[email protected]> --------- Signed-off-by: Tushar Goel <[email protected]>
1 parent 1ff2e90 commit 1a78756

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ Release notes
22
=============
33

44

5+
Version v33.6.1
6+
----------------
7+
8+
- We added pagination to valid versions improver.
9+
10+
511
Version v33.6.0
612
----------------
713

vulnerabilities/improve_runner.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def run(self) -> None:
4949
process_inferences(
5050
inferences=inferences,
5151
advisory=advisory,
52-
improver_model_object=improver.qualified_name,
52+
improver_name=improver.qualified_name,
5353
)
5454
except Exception as e:
5555
logger.info(f"Failed to process advisory: {advisory!r} with error {e!r}")
@@ -149,9 +149,6 @@ def process_inferences(inferences: List[Inference], advisory: Advisory, improver
149149
cwe_obj.save()
150150

151151
inferences_processed_count += 1
152-
153-
advisory.date_imported = datetime.now(timezone.utc)
154-
advisory.save()
155152
return inferences_processed_count
156153

157154

vulnerabilities/improvers/valid_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self) -> None:
6767

6868
@property
6969
def interesting_advisories(self) -> QuerySet:
70-
return Advisory.objects.filter(Q(created_by=self.importer.qualified_name))
70+
return Advisory.objects.filter(Q(created_by=self.importer.qualified_name)).paginated()
7171

7272
def get_package_versions(
7373
self, package_url: PackageURL, until: Optional[datetime] = None

0 commit comments

Comments
 (0)