From 87066b0cea3fcd0cc8b2389b95241d794ca14dbf Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 14 Nov 2024 21:54:32 +0100 Subject: [PATCH] feat: add signup-reason --- .../migrations/0021_user_reason_for_signup.py | 19 +++++++++++++++++++ src/fellchensammlung/models.py | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 src/fellchensammlung/migrations/0021_user_reason_for_signup.py diff --git a/src/fellchensammlung/migrations/0021_user_reason_for_signup.py b/src/fellchensammlung/migrations/0021_user_reason_for_signup.py new file mode 100644 index 0000000..7b83916 --- /dev/null +++ b/src/fellchensammlung/migrations/0021_user_reason_for_signup.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.1 on 2024-11-14 20:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fellchensammlung', '0020_alter_rescueorganization_internal_comment'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='reason_for_signup', + field=models.TextField(default='-', verbose_name='Grund für die Registrierung'), + preserve_default=False, + ), + ] diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 86d75d1..495d82f 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -149,6 +149,8 @@ class User(AbstractUser): updated_at = models.DateTimeField(auto_now=True) organization_affiliation = models.ForeignKey(RescueOrganization, on_delete=models.PROTECT, null=True, blank=True, verbose_name=_('Organisation')) + reason_for_signup = models.TextField(verbose_name=_("Grund für die Registrierung")) + REQUIRED_FIELDS = ["reason_for_signup", "email"] class Meta: verbose_name = _('Nutzer*in')