• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

liqd / adhocracy-plus / 18908688697

29 Oct 2025 12:59PM UTC coverage: 44.622% (-44.5%) from 89.135%
18908688697

Pull #2986

github

web-flow
Merge 1dfde8ee7 into 445e1d498
Pull Request #2986: Draft: Speed up Github Ci Tests

3012 of 6750 relevant lines covered (44.62%)

0.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/newsletters/emails.py
1
from django.apps import apps
×
2
from django.conf import settings
×
3
from django.contrib import auth
×
4

5
from adhocracy4.emails.mixins import ReportToAdminEmailMixin
×
6
from apps.users.emails import EmailAplus as Email
×
7

8
Organisation = apps.get_model(settings.A4_ORGANISATIONS_MODEL)
×
9
User = auth.get_user_model()
×
10

11

12
class NewsletterEmail(ReportToAdminEmailMixin, Email):
×
13
    template_name = "a4_candy_newsletters/emails/newsletter_email"
×
14

15
    def dispatch(self, object, *args, **kwargs):
×
16
        organisation_pk = kwargs.pop("organisation_pk", None)
×
17
        organisation = None
×
18
        if organisation_pk:
×
19
            organisation = Organisation.objects.get(pk=organisation_pk)
×
20
        kwargs["organisation"] = organisation
×
21

22
        return super().dispatch(object, *args, **kwargs)
×
23

24
    def get_reply_to(self):
×
25
        return [self.object.sender]
×
26

27
    def get_organisation(self):
×
28
        return self.kwargs["organisation"]
×
29

30
    def get_receivers(self):
×
31
        return (
×
32
            User.objects.filter(id__in=self.kwargs["participant_ids"])
33
            .filter(get_newsletters=True)
34
            .filter(is_active=True)
35
            .distinct()
36
        )
37

38

39
class NewsletterEmailAll(NewsletterEmail):
×
40
    def get_receivers(self):
×
41
        return User.objects.filter(is_active=True).distinct()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc