gitlab: Fix creating new projects

Julien LepillerSun Aug 29 14:25:20+0200 2021

b81db8d

gitlab: Fix creating new projects

offlate/systems/gitlab.py

9090
    @staticmethod
9191
    def getProjectConfigSpec():
9292
        return [StringConfigSpec('repo', Project.tr('Repository'),
93-
            Project.tr('Full clone URL for the repository'),
94-
            Project.tr('https://...')),
93+
                    Project.tr('Full clone URL for the repository'),
94+
                    'https://...'),
9595
                StringConfigSpec('branch', Project.tr('Branch'),
9696
                    Project.tr('Name of the branch to translate'),
9797
                    Project.tr('master'))]

108108
                    [
109109
                    StringConfigSpec('server', Project.tr('Server'),
110110
                        Project.tr('Server name'),
111-
                        placeholder = Project.tr('https://gitlab.com')),
111+
                        placeholder = 'gitlab.com'),
112112
                    StringConfigSpec('token', Project.tr('Token'),
113113
                        Project.tr('The token you created from your account'),
114-
                        placeholder = Project.tr('Lynid8y56urst-TdlUs6'))
114+
                        placeholder = 'Lynid8y56urst-TdlUs6')
115115
                    ],
116116
                    'server',
117117
                    GitlabProject.hasRequiredRow))

123123
        Method used by the configuration system: it checks that the configuration
124124
        refers to a server whose configuration is valid.
125125
        """
126-
        server = urlparse(self.uri).hostname
126+
        server = urlparse(conf['repo']).hostname
127127
        
128128
        for serv in servers:
129129
            if serv["server"] == server: