diff --git a/api/migrations/0002_alter_contributor_name.py b/api/migrations/0002_alter_contributor_name.py new file mode 100644 index 0000000..08dc667 --- /dev/null +++ b/api/migrations/0002_alter_contributor_name.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.25 on 2025-01-10 18:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='contributor', + name='name', + field=models.TextField(null=True, verbose_name='name'), + ), + ] diff --git a/api/models/contributor.py b/api/models/contributor.py index 3ea9f77..42716d7 100644 --- a/api/models/contributor.py +++ b/api/models/contributor.py @@ -40,7 +40,7 @@ class Contributor(AbstractBaseUser): id = models.IntegerField( primary_key=True, help_text=_("The contributor's GitHub user-ID.") ) - name = models.TextField(_("name")) + name = models.TextField(_("name"), null=True) location = models.TextField(_("location"), null=True) html_url = models.TextField(_("html url")) avatar_url = models.TextField(_("avatar url")) @@ -129,7 +129,7 @@ def sync_with_github(cls, auth: str): except Contributor.DoesNotExist: contributor = Contributor(id=github_user["id"]) - contributor.name = github_user["name"] + contributor.name = github_user.get("name") contributor.location = github_user.get("location") contributor.html_url = github_user["html_url"] contributor.avatar_url = github_user["avatar_url"] diff --git a/settings.py b/settings.py index 76b6ae9..b682a9d 100644 --- a/settings.py +++ b/settings.py @@ -1,6 +1,6 @@ """ © Ocado Group -Created on 04/07/2024 at 11:42:01(+01:00). +Created on 04/07/2024 at 11:42:00(+01:00). Django settings for api.