feat: Add field for user to opt-out of e-mail notifications
This commit is contained in:
		@@ -0,0 +1,18 @@
 | 
			
		||||
# Generated by Django 5.1.1 on 2024-11-20 19:25
 | 
			
		||||
 | 
			
		||||
from django.db import migrations, models
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ('fellchensammlung', '0022_alter_user_reason_for_signup_alter_user_trust_level'),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.AddField(
 | 
			
		||||
            model_name='user',
 | 
			
		||||
            name='email_notifications',
 | 
			
		||||
            field=models.BooleanField(default=True, verbose_name='Benachrichtigung per E-Mail'),
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
@@ -150,6 +150,7 @@ class User(AbstractUser):
 | 
			
		||||
                                                 verbose_name=_('Organisation'))
 | 
			
		||||
    reason_for_signup = models.TextField(verbose_name=_("Grund für die Registrierung"), help_text=_(
 | 
			
		||||
        "Wir würden gerne wissen warum du dich registriertst, ob du dich z.B. Tiere eines bestimmten Tierheim einstellen willst 'nur mal gucken' willst. Beides ist toll! Wenn du für ein Tierheim/eine Pflegestelle arbeitest kontaktieren wir dich ggf. um dir erweiterte Rechte zu geben."))
 | 
			
		||||
    email_notifications = models.BooleanField(verbose_name=_("Benachrichtigung per E-Mail"), default=True)
 | 
			
		||||
    REQUIRED_FIELDS = ["reason_for_signup", "email"]
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user