diff --git a/data/contrib_data.py b/data/contrib_data.py index aacbab89..d4e63aab 100644 --- a/data/contrib_data.py +++ b/data/contrib_data.py @@ -32,6 +32,9 @@ def import_data(contributor): try: contributor['issues_opened'] = contributor.pop('issues') contributor['num_commits'] = contributor.pop('contributions') + contributor_location = contributor.get('location') + if contributor_location: + contributor['location'] = contributor_location contributor.pop('teams') c, create = Contributor.objects.get_or_create( **contributor diff --git a/data/migrations/0005_contributor_location.py b/data/migrations/0005_contributor_location.py new file mode 100644 index 00000000..2d671c7c --- /dev/null +++ b/data/migrations/0005_contributor_location.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2019-06-08 08:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('data', '0004_auto_20180809_2229'), + ] + + operations = [ + migrations.AddField( + model_name='contributor', + name='location', + field=models.TextField(default=None, null=True), + ), + ] diff --git a/data/models.py b/data/models.py index b6ba1a0e..92f3dcbe 100644 --- a/data/models.py +++ b/data/models.py @@ -15,6 +15,7 @@ class Contributor(models.Model): num_commits = models.IntegerField(default=None, null=True) reviews = models.IntegerField(default=None, null=True) issues_opened = models.IntegerField(default=None, null=True) + location = models.TextField(default=None, null=True) teams = models.ManyToManyField(Team) def __str__(self):