← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~lgp171188/launchpad:fix-distribution-cvereport-page-timeout into launchpad:master

 


Diff comments:

> diff --git a/lib/lp/bugs/browser/cvereport.py b/lib/lp/bugs/browser/cvereport.py
> index c2f1b65..fff4f2b 100644
> --- a/lib/lp/bugs/browser/cvereport.py
> +++ b/lib/lp/bugs/browser/cvereport.py
> @@ -65,14 +67,25 @@ class CVEReportView(LaunchpadView):
>      def initialize(self):
>          """See `LaunchpadView`."""
>          super().initialize()
> +        self.open_cve_bugtasks = []
> +        self.resolved_cve_bugtasks = []
> +
> +        # If we are dealing with a distribution with one or more series,
> +        # there is no need to deal with the open and resolved CVE bugtasks.
> +        # This is because the template only renders links to the CVE report
> +        # page of each available series.
> +        if (
> +            isinstance(removeSecurityProxy(self.context), Distribution)

Colin, this is the usage of `removeSecurityProxy()` that I mentioned in the stand-up meeting.

> +            and self.context.series
> +        ):
> +            return
> +
>          search_params = BugTaskSearchParams(self.user, has_cve=True)
>          bugtasks = shortlist(
>              self.context.searchTasks(search_params), longest_expected=600
>          )
>  
>          if not bugtasks:
> -            self.open_cve_bugtasks = []
> -            self.resolved_cve_bugtasks = []
>              return
>  
>          bugtask_set = getUtility(IBugTaskSet)


-- 
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/430886
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:fix-distribution-cvereport-page-timeout into launchpad:master.



References