Verified Commit b3e16e84 authored by Adrian DC's avatar Adrian DC
Browse files

fix(entrypoint): resolve user projects list type handlings

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 5b412776
Loading
Loading
Loading
Loading
Loading
+5 −4
Changes for src/cli/entrypoint.py: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ from argparse import Namespace
from enum import Enum
import re
from tempfile import NamedTemporaryFile
from typing import cast, List, Optional, Union
from typing import List, Optional, Union
import urllib.parse

# Modules libraries
@@ -21,6 +21,7 @@ from gitlab.v4.objects import (
    Project as GitLabProject,
    ProjectImport as GitLabProjectImport,
    User as GitLabUser,
    UserProject as GitLabUserProject,
)
import questionary

@@ -72,6 +73,8 @@ class Entrypoint:
        output_namespace: Optional[GitLabNamespace] = None
        progress_count: int
        progress_index: int
        project: Union[GitLabGroupProject, GitLabUserProject]
        projects: Union[List[GitLabGroupProject], List[GitLabUserProject]]
        result: Entrypoint.Result

        # Header
@@ -453,13 +456,11 @@ class Entrypoint:
            # Iterate through projects
            if not options.exclude_projects:
                projects = sorted(
                    cast(
                        List[GitLabGroupProject],
                    input_user.projects.list(
                        get_all=True,
                        order_by='path',
                        sort='asc',
                        )),
                    ),
                    key=lambda item: item.path_with_namespace,
                )
                progress_count = len(projects)