Die Wartungsarbeiten sind beendet. Bei Problemen meldet euch im Digitale Infrastruktur-Raum des Hackspace.

Commit b710bdce authored by Robert's avatar Robert
Browse files

Allow users to block all notifications, refs #704

parent a0ff90b8
......@@ -23,7 +23,8 @@ class Notification:
@classmethod
def send_all(cls, instance, **extra_kwargs):
for recipient, kwargs in cls.get_recipients(instance).items():
if recipient.id != settings.GROUPRISE.get('FEED_IMPORTER_GESTALT_ID'):
if (not recipient.is_email_blocker) and (
recipient.id != settings.GROUPRISE.get('FEED_IMPORTER_GESTALT_ID')):
kwargs.update(extra_kwargs)
cls(instance).send(recipient, **kwargs)
......
......@@ -63,7 +63,7 @@ class Create(allauth.account.forms.SignupForm):
class Update(forms.ModelForm):
class Meta:
model = models.Gestalt
fields = ('about', 'public')
fields = ('about', 'is_email_blocker', 'public')
widgets = {'about': forms.Textarea({'rows': 5})}
first_name = forms.CharField(label='Vorname', required=False)
......
# Generated by Django 2.2.17 on 2021-02-08 11:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestalten', '0014_auto_20190815_0926'),
]
operations = [
migrations.AddField(
model_name='gestalt',
name='is_email_blocker',
field=models.BooleanField(default=False, help_text='Unabhängig von Abonnements alle Benachrichtigungen via E-Mail deaktivieren', verbose_name='E-Mail-Benachrichtigungen ausschalten'),
),
]
......@@ -53,6 +53,11 @@ class Gestalt(grouprise.core.models.Model):
score = models.IntegerField(default=0)
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
activity_bookmark_time = models.DateTimeField(default=now)
is_email_blocker = models.BooleanField(
'E-Mail-Benachrichtigungen ausschalten',
default=False,
help_text='Unabhängig von Abonnements alle Benachrichtigungen via E-Mail deaktivieren'
)
associations = django.contrib.contenttypes.fields.GenericRelation(
'associations.Association', content_type_field='entity_type',
......
......@@ -17,6 +17,7 @@
<div class="col-md-6">
{% field form.about %}
{% field_checkbox form.public %}
{% field_checkbox form.is_email_blocker %}
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment