swh.lister.gitlab: Do not store information we cannot have

This commit is contained in:
Antoine R. Dumont (@ardumont) 2018-07-03 16:31:25 +02:00
parent d9d582f7eb
commit db36c499fe
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
2 changed files with 2 additions and 9 deletions

View file

@ -96,11 +96,6 @@ class GitLabLister(SWHIndexingHttpLister):
'origin_url': repo['http_url_to_repo'],
'origin_type': 'git',
'description': repo['description'],
# FIXME: How to determine the fork nature? Do we need that
# information? Variable `repo` holds a `count_fork` key
# which is the number of forks for that
# repository. Default to False for now.
'fork': False,
}
def transport_quota_check(self, response):

View file

@ -2,7 +2,7 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from sqlalchemy import Column, Boolean, Integer, String
from sqlalchemy import Column, Integer, String
from ..core.models import ModelBase
@ -17,16 +17,14 @@ class GitLabModel(ModelBase):
uid = Column(Integer, index=True)
instance = Column(String, index=True)
indexable = Column(Integer, index=True)
fork = Column(Boolean)
def __init__(self, uid=None, indexable=None, name=None,
full_name=None, html_url=None, origin_url=None,
origin_type=None, description=None, task_id=None,
origin_id=None, instance=None, **kwargs):
origin_id=None, instance=None):
super().__init__(uid=uid, indexable=indexable, name=name,
full_name=full_name, html_url=html_url,
origin_url=origin_url, origin_type=origin_type,
description=description, task_id=task_id,
origin_id=origin_id)
self.fork = kwargs.pop('fork', False)
self.instance = instance