Skip to content

Commit

Permalink
Revert "communications: Add log to estimate new emails count"
Browse files Browse the repository at this point in the history
This reverts commit 45398dd.
  • Loading branch information
tonial committed Dec 3, 2024
1 parent 10c1366 commit 24fad62
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions itou/communications/dispatch/email.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import logging

from itou.prescribers.models import PrescriberMembership
from itou.utils.emails import get_email_message

from .base import BaseNotification


logger = logging.getLogger(__name__)


class EmailNotification(BaseNotification):
REQUIRED = BaseNotification.REQUIRED + ["subject_template", "body_template"]

def build(self):
# TODO: Temporary log for analysis : remove by the end of November 2024
if self.user.is_prescriber and self.structure:
memberships = (
PrescriberMembership.objects.active().filter(organization=self.structure).select_related("user")
)
members = [m.user for m in memberships]
if self.user not in members:
admin_count = len([m for m in memberships if m.is_admin])
logger.info("Estimate new email sent to admin_count=%d", admin_count)
return get_email_message(
[self.user.email],
self.get_context(),
Expand Down

0 comments on commit 24fad62

Please sign in to comment.