swh.lister.gitlab: Change uid format

This commit is contained in:
Antoine R. Dumont (@ardumont) 2018-07-12 13:44:59 +02:00
parent 4db15aaf16
commit cd98af7705
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
2 changed files with 5 additions and 3 deletions

View file

@ -66,10 +66,13 @@ class GitLabLister(PageByPageHttpLister):
params['auth'] = (auth['username'], auth['password'])
return params
def uid(self, repo):
return '%s/%s' % (self.instance, repo['path_with_namespace'])
def get_model_from_repo(self, repo):
return {
'instance': self.instance,
'uid': repo['id'],
'uid': self.uid(repo),
'name': repo['name'],
'full_name': repo['path_with_namespace'],
'html_url': repo['web_url'],

View file

@ -13,8 +13,7 @@ class GitLabModel(ModelBase):
"""
__tablename__ = 'gitlab_repo'
id = Column(Integer, primary_key=True)
uid = Column(Integer, index=True)
uid = Column(String, primary_key=True)
instance = Column(String, index=True)
def __init__(self, uid=None, indexable=None, name=None,