diff --git a/contributors/migrations/0014_repository_fork.py b/contributors/migrations/0014_repository_fork.py new file mode 100644 index 00000000..b38e942d --- /dev/null +++ b/contributors/migrations/0014_repository_fork.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.4 on 2023-11-21 12:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("contributors", "0013_alter_label_name"), + ] + + operations = [ + migrations.AddField( + model_name="repository", + name="fork", + field=models.BooleanField(default=False, verbose_name="fork"), + ), + ] diff --git a/contributors/models/repository.py b/contributors/models/repository.py index a21b10ce..9c85df22 100644 --- a/contributors/models/repository.py +++ b/contributors/models/repository.py @@ -43,6 +43,7 @@ class Repository(CommonFields): blank=True, ) full_name = models.CharField(_("full name"), max_length=FULL_NAME_LENGTH) + fork = models.BooleanField(_("fork"), default=False) is_visible = models.BooleanField(_("visible"), default=True) labels = models.ManyToManyField( Label, diff --git a/contributors/utils/misc.py b/contributors/utils/misc.py index 3541f37c..7ef50862 100644 --- a/contributors/utils/misc.py +++ b/contributors/utils/misc.py @@ -47,6 +47,7 @@ def update_or_create_record(cls, github_resp, additional_fields=None): else None ), 'full_name': github_resp['full_name'], + 'fork': github_resp['fork'], }, 'Contributor': lambda: { 'login': github_resp['login'], diff --git a/templates/components/tables/repositories_list.html b/templates/components/tables/repositories_list.html index ff5fa361..37f9c8d6 100644 --- a/templates/components/tables/repositories_list.html +++ b/templates/components/tables/repositories_list.html @@ -33,9 +33,15 @@