Diff comments:

> diff --git a/lib/lp/registry/browser/ociproject.py 
> b/lib/lp/registry/browser/ociproject.py
> index 7c3f719..2f07dd6 100644
> --- a/lib/lp/registry/browser/ociproject.py
> +++ b/lib/lp/registry/browser/ociproject.py
> @@ -238,12 +236,18 @@ class OCIProjectIndexView(LaunchpadView):
>          return urlsplit(config.codehosting.git_ssh_root).hostname
>  
>      @cachedproperty
> +    def official_recipes(self):
> +        return self.context.getOfficialRecipes(visible_by_user=self.user)

I guess either way should be fine: we expect this list to be short enough to 
not impact memory usage; and we use it only once in the template, so we don't 
really need to cache it.

I'll define it as `@property`, just in case someone goes crazy and creates 
thousands of official recipes in an OCI project.

> +
> +    @cachedproperty
>      def official_recipe_count(self):
> -        return self.context.getOfficialRecipes().count()
> +        return self.context.getOfficialRecipes(
> +            visible_by_user=self.user).count()
>  
>      @cachedproperty
>      def other_recipe_count(self):
> -        return self.context.getUnofficialRecipes().count()
> +        return self.context.getUnofficialRecipes(
> +            visible_by_user=self.user).count()
>  
>  
>  class OCIProjectEditView(LaunchpadEditFormView):


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399886
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:ocirecipe-subscription-ui.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to