Repository: OpenBB-finance/OpenBBTerminal
File: openbb_terminal/account/account_controller.py (Python)

Code before:
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="download",
            description="Download a routine from the cloud.",
        )
        parser.add_argument(
            "-n",
            "--name",
            type=str,
            dest="name",
            help="The name of the routine.",
            required="-h" not in other_args
            and "--help" not in other_args
            and not is_local(),
            nargs="+",
        )
        if other_args and "-" not in other_args[0][0]:
            other_args.insert(0, "-n")
        ns_parser = self.parse_known_args_and_warn(parser, other_args)
        if is_local() and "-h" not in other_args and "--help" not in other_args:
            print_guest_block_msg()
        else:
            if ns_parser:
                data = None

                # Default routine
                name = " ".join(ns_parser.name)
                if name in self.DEFAULT_CHOICES:
                    data = [next(
                        (r for r in self.DEFAULT_ROUTINES if r["name"] == name), None
                    ), "default"]
                else:
                    # User routine
                    response = Hub.download_routine(
                        auth_header=get_current_user().profile.get_auth_header(),
                        name=name,
                    )
                    data = [(
                        response.json()
                        if response and response.status_code == 200
                        else None
                    ), "personal"]

                # Save routine
                if data[0]:
                    name = data[0].get("name", "")
                    if name:
                        console.print(f"[info]Name:[/info] {name}")

                    description = data[0].get("description", "")
                    if description:

Review comment (security):
Here we should give priority to user routines if there's a naming conflict.

```python
                name = " ".join(ns_parser.name)
                if name in self.REMOTE_CHOICES:
                    # User routine
                    response = Hub.download_routine(
                        auth_header=get_current_user().profile.get_auth_header(),
                        name=name,
                    )
                    data = [
                        (
                            response.json()
                            if response and response.status_code == 200
                            else None
                        ),
                        "personal",
                    ]
                else:
                    # Default routine
                    data = [
                        next(
                            (r for r in self.DEFAULT_ROUTINES if r["name"] == name),
                            None,
                        ),
                        "default",
                    ]
```

Code after:
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="download",
            description="Download a routine from the cloud.",
        )
        parser.add_argument(
            "-n",
            "--name",
            type=str,
            dest="name",
            help="The name of the routine.",
            required="-h" not in other_args
            and "--help" not in other_args
            and not is_local(),
            nargs="+",
        )
        if other_args and "-" not in other_args[0][0]:
            other_args.insert(0, "-n")
        ns_parser = self.parse_known_args_and_warn(parser, other_args)
        if is_local() and "-h" not in other_args and "--help" not in other_args:
            print_guest_block_msg()
        else:
            if ns_parser:
                data = []
                name = " ".join(ns_parser.name)
                # Personal routines
                response = Hub.download_routine(
                    auth_header=get_current_user().profile.get_auth_header(),
                    name=name,
                )
                if response and response.status_code == 200:
                    data = [response.json(), "personal"]
                # Default routine
                elif name in self.DEFAULT_CHOICES:
                    data = [
                        next(
                            (r for r in self.DEFAULT_ROUTINES if r["name"] == name),
                            None,
                        ),
                        "default",
                    ]

                # Save routine
                if data[0]:
                    name = data[0].get("name", "")
                    if name:
                        console.print(f"[info]Name:[/info] {name}")

                    description = data[0].get("description", "")
                    if description:
                        console.print(f"[info]Description:[/info] {description}")