Skip to content

Commit

Permalink
fix: name is nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jan 10, 2025
1 parent 111d5f5 commit 2fd85e7
Showing 3 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions api/migrations/0002_alter_contributor_name.py
Original file line number Diff line number Diff line change
@@ -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'),
),
]
4 changes: 2 additions & 2 deletions api/models/contributor.py
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 2fd85e7

Please sign in to comment.