← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~pappacena/launchpad:ocirecipe-git-instructions into launchpad:master

 


Diff comments:

> diff --git a/lib/lp/oci/browser/ocirecipe.py b/lib/lp/oci/browser/ocirecipe.py
> index f18779d..acf83cf 100644
> --- a/lib/lp/oci/browser/ocirecipe.py
> +++ b/lib/lp/oci/browser/ocirecipe.py
> @@ -773,10 +773,29 @@ class OCIRecipeAddView(LaunchpadFormView, EnableProcessorsMixin,
>              "architectures are restricted and may only be enabled or "
>              "disabled by administrators.")
>  
> +    def setUpGitRefWidget(self):
> +        """Setup GitRef widget indicating the user to use the default
> +        oci project's git repository, if possible.
> +        """
> +        path = self.context.getDefaultGitRepositoryPath(self.user)
> +        widget = self.widgets["git_ref"]
> +        widget.setUpSubWidgets()
> +        widget.repository_widget.setRenderedValue(path)
> +        default_repo = self.context.getDefaultGitRepository(self.user)
> +        if default_repo is None:
> +            msg = (
> +                "Your git repository for this OCI project was not created yet."
> +                "<br/>Check the <a href='{oci_proj_url}'>OCI project page"
> +                "</a> for instructions on how to create one.")
> +            msg = structured(
> +                msg.format(oci_proj_url=canonical_url(self.context)))

Right! Changing it!

> +            self.widget_errors["git_ref"] = msg.escapedtext
> +
>      def setUpWidgets(self):
>          """See `LaunchpadFormView`."""
>          super(OCIRecipeAddView, self).setUpWidgets()
>          self.widgets["processors"].widget_class = "processors"
> +        self.setUpGitRefWidget()
>  
>      @property
>      def cancel_url(self):


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395253
Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:ociproject-git-instructions.


References