swh.lister.gitlab: Use gitlab's index identifier (page id)

And not 'project' id
This commit is contained in:
Antoine R. Dumont (@ardumont) 2018-06-28 11:33:42 +02:00
parent 3e62bc867e
commit 1335a5b25f
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -11,10 +11,12 @@ from .models import GitlabModel
class GitlabLister(SWHIndexingHttpLister):
# Path to give and mentioning the last id for the next page
PATH_TEMPLATE = '/projects?since=%d&visibility=public'
PATH_TEMPLATE = '/projects?page=%d'
# base orm model
MODEL = GitlabModel
API_URL_INDEX_RE = re.compile(r'^.*/projects\?since=(\d+)&visibility=public')
# gitlab api do not have an indexable identifier so using the page
# id
API_URL_INDEX_RE = re.compile(r'^.*/projects.*\&page=(\d+).*')
def get_model_from_repo(self, repo):
return {