diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fb83ba81f6f8ccac1dc82fb4b1b89729d8b89875..0e64d8bc4c633a3801a77512c474e89bf55814da 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,7 +21,7 @@ Fixed * PDFs generated in background didn't contain logo or site title. * Admins were redirected to their user preferences while they wanted to edit the preferences of another user. -* Place of birth was not correctly shown in the person detail view +* Some CharFields were using NULL values in database when field is empty Changed ~~~~~~~ diff --git a/aleksis/core/migrations/0028_default_value_place_of_birth.py b/aleksis/core/migrations/0028_default_value_place_of_birth.py index 8c5547d77b02f760455701b8e328f533445c17af..8569faba9002255cd3d2fc7565ce2c8ea7ea44ae 100644 --- a/aleksis/core/migrations/0028_default_value_place_of_birth.py +++ b/aleksis/core/migrations/0028_default_value_place_of_birth.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.10 on 2021-12-15 20:00 +# Generated by Django 3.2.10 on 2021-12-15 21:10 from django.db import migrations, models @@ -10,18 +10,6 @@ class Migration(migrations.Migration): ] operations = [ - migrations.AlterField( - model_name='person', - name='place_of_birth', - field=models.CharField(blank=True, default='', max_length=255, verbose_name='Place of birth'), - preserve_default=False, - ), - migrations.AlterField( - model_name='person', - name='short_name', - field=models.CharField(blank=True, default='', max_length=255, verbose_name='Short name'), - preserve_default=False, - ), migrations.AlterField( model_name='group', name='short_name', @@ -31,7 +19,13 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='oauthapplication', name='authorization_grant_type', - field=models.CharField(blank=True, choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-creden + field=models.CharField(blank=True, choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], default='', max_length=32), + preserve_default=False, + ), + migrations.AlterField( + model_name='person', + name='place_of_birth', + field=models.CharField(blank=True, default='', max_length=255, verbose_name='Place of birth'), preserve_default=False, ), ] diff --git a/aleksis/core/models.py b/aleksis/core/models.py index 2a50f8bc1c124a62dff931eb68e812e94899a8f5..8a8ec40af86ccb91fded46f58c2b0c9b9201ce84 100644 --- a/aleksis/core/models.py +++ b/aleksis/core/models.py @@ -180,7 +180,7 @@ class Person(ExtensibleModel): ) short_name = models.CharField( - verbose_name=_("Short name"), max_length=255, blank=True # noqa + verbose_name=_("Short name"), max_length=255, blank=True, null=True # noqa ) street = models.CharField(verbose_name=_("Street"), max_length=255, blank=True) @@ -424,7 +424,7 @@ class Group(SchoolTermRelatedExtensibleModel): name = models.CharField(verbose_name=_("Long name"), max_length=255) short_name = models.CharField( - verbose_name=_("Short name"), max_length=255, blank=True # noqa + verbose_name=_("Short name"), max_length=255, blank=True, null=True # noqa ) members = models.ManyToManyField(