Implement 'send_email_alerts'

* cascading from team to project; user is base-level-default
* implemented at form-level
* implemented when emails are actually sent
This commit is contained in:
Klaas van Schelven
2024-06-13 13:23:14 +02:00
parent 35448c9855
commit 95cb39f5af
7 changed files with 126 additions and 17 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.2.13 on 2024-06-12 14:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_emailverification'),
]
operations = [
migrations.AddField(
model_name='user',
name='send_email_alerts',
field=models.BooleanField(blank=True, default=True),
),
]

View File

@@ -10,6 +10,13 @@ class User(AbstractUser):
# > User model is sufficient for you. This model behaves identically to the default user model, but youll be able
# > to customize it in the future if the need arises
# (The above is no longer the only reason for a custom User model, since we started introducing custom fields.
# Regarding those fields, there is some pressure in the docs to put UserProfile fields in a separate model, but
# as long as the number of fields is small I think the User model makes more sense. We can always push them out
# later)
send_email_alerts = models.BooleanField(default=True, blank=True)
class Meta:
db_table = 'auth_user'