diff --git a/src/open_inwoner/accounts/migrations/0069_alter_user_postcode.py b/src/open_inwoner/accounts/migrations/0069_alter_user_postcode.py new file mode 100644 index 0000000000..2249cd6b51 --- /dev/null +++ b/src/open_inwoner/accounts/migrations/0069_alter_user_postcode.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.20 on 2023-12-04 09:07 + +from django.db import migrations + +import localflavor.nl.models + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0068_relax_email_constraint_for_eherkenning"), + ] + + operations = [ + migrations.AlterField( + model_name="user", + name="postcode", + field=localflavor.nl.models.NLZipCodeField( + blank=True, default="", max_length=7, verbose_name="Postcode" + ), + ), + ] diff --git a/src/open_inwoner/accounts/models.py b/src/open_inwoner/accounts/models.py index 2ea5d54f28..a7b146297e 100644 --- a/src/open_inwoner/accounts/models.py +++ b/src/open_inwoner/accounts/models.py @@ -151,7 +151,7 @@ class User(AbstractBaseUser, PermissionsMixin): verbose_name=_("House number"), default="", blank=True, max_length=250 ) postcode = NLZipCodeField( - verbose_name=_("Postcode"), null=True, blank=True, max_length=250 + verbose_name=_("Postcode"), blank=True, default="", max_length=250 ) city = models.CharField( verbose_name=_("City"), @@ -350,7 +350,7 @@ def get_age(self): def get_address(self): if self.street: - return f"{self.street} {self.housenumber}, {self.city}" + return f"{self.street} {self.housenumber}, {self.postcode} {self.city}" return "" def get_new_messages_total(self) -> int: diff --git a/src/open_inwoner/templates/pages/profile/me.html b/src/open_inwoner/templates/pages/profile/me.html index 71d791117d..0fcc9ad613 100644 --- a/src/open_inwoner/templates/pages/profile/me.html +++ b/src/open_inwoner/templates/pages/profile/me.html @@ -11,7 +11,7 @@