Skip to content

Commit

Permalink
Do not display version warning when version is not set #659
Browse files Browse the repository at this point in the history
"queued" run for example

Signed-off-by: Thomas Druez <[email protected]>
  • Loading branch information
tdruez committed May 23, 2023
1 parent 02fdaf0 commit 7921fd6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scanpipe/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,18 @@ def check_run_scancode_version(self, pipeline_runs, version_limit="32.2.0"):
Display a warning message if one of the ``pipeline_runs`` scancodeio_version
is prior to or currently is ``old_version``.
"""
if run_versions := [run.scancodeio_version for run in pipeline_runs]:
run_versions = [
run.scancodeio_version for run in pipeline_runs if run.scancodeio_version
]
if run_versions and min(run_versions) <= version_limit:
message = (
"WARNING: Some this project pipelines have been run with an "
"out of date ScanCode-toolkit version.\n"
"The scan data was migrated, but it is recommended to reset the "
"project and re-run the pipelines to benefit from the latest "
"scan results improvements."
)
if min(run_versions) <= version_limit:
messages.warning(self.request, message)
messages.warning(self.request, message)

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
Expand Down

0 comments on commit 7921fd6

Please sign in to comment.