|
9 | 9 | from django.utils.translation import gettext as _ |
10 | 10 |
|
11 | 11 | from hypha.apply.activity import tasks |
12 | | -from hypha.apply.activity.models import ALL, APPLICANT_PARTNERS, PARTNER |
13 | 12 | from hypha.apply.funds.models.co_applicants import ( |
14 | 13 | CoApplicantProjectPermission, |
15 | 14 | CoApplicantRole, |
@@ -65,8 +64,6 @@ class EmailAdapter(AdapterBase): |
65 | 64 | MESSAGES.READY_FOR_REVIEW: "handle_ready_for_review", |
66 | 65 | MESSAGES.REVIEWERS_UPDATED: "handle_ready_for_review", |
67 | 66 | MESSAGES.BATCH_REVIEWERS_UPDATED: "handle_batch_ready_for_review", |
68 | | - MESSAGES.PARTNERS_UPDATED: "partners_updated_applicant", |
69 | | - MESSAGES.PARTNERS_UPDATED_PARTNER: "partners_updated_partner", |
70 | 67 | MESSAGES.UPLOAD_CONTRACT: "messages/email/contract_uploaded.html", |
71 | 68 | MESSAGES.SUBMIT_CONTRACT_DOCUMENTS: "messages/email/submit_contract_documents.html", |
72 | 69 | MESSAGES.CREATED_PROJECT: "messages/email/project_created.html", |
@@ -328,10 +325,6 @@ def recipients(self, message_type, source, user, **kwargs): |
328 | 325 | related = kwargs.get("related", None) |
329 | 326 | return [related.invited_user_email] |
330 | 327 |
|
331 | | - if message_type == MESSAGES.PARTNERS_UPDATED_PARTNER: |
332 | | - partners = kwargs["added"] |
333 | | - return [partner.email for partner in partners] |
334 | | - |
335 | 328 | if message_type == MESSAGES.APPROVE_PAF: |
336 | 329 | from hypha.apply.projects.models.project import ProjectSettings |
337 | 330 |
|
@@ -488,12 +481,6 @@ def recipients(self, message_type, source, user, **kwargs): |
488 | 481 | ).values_list("user__email", flat=True) |
489 | 482 | recipients: List[str] = [source.user.email, *co_applicants] |
490 | 483 |
|
491 | | - if partners := list(source.partners.values_list("email", flat=True)): |
492 | | - if comment.visibility == PARTNER: |
493 | | - recipients = partners |
494 | | - elif comment.visibility in [APPLICANT_PARTNERS, ALL]: |
495 | | - recipients += partners |
496 | | - |
497 | 484 | # Comment handling for Projects |
498 | 485 | elif isinstance(source, Project): |
499 | 486 | # co_applciants with Comment permission |
@@ -557,23 +544,6 @@ def reviewers(self, source): |
557 | 544 | and not reviewer.is_apply_staff |
558 | 545 | ] |
559 | 546 |
|
560 | | - def partners_updated_applicant(self, added, removed, **kwargs): |
561 | | - if added: |
562 | | - return self.render_message( |
563 | | - "messages/email/partners_update_applicant.html", added=added, **kwargs |
564 | | - ) |
565 | | - |
566 | | - def partners_updated_partner(self, added, removed, **kwargs): |
567 | | - if added: |
568 | | - recipient = kwargs["recipient"] |
569 | | - # Pass the user object to render_message rather than the email string |
570 | | - recipient_obj = User.objects.get(email__exact=recipient) |
571 | | - kwargs["recipient"] = recipient_obj |
572 | | - |
573 | | - return self.render_message( |
574 | | - "messages/email/partners_update_partner.html", **kwargs |
575 | | - ) |
576 | | - |
577 | 547 | def render_message(self, template, **kwargs): |
578 | 548 | with language(settings.LANGUAGE_CODE): |
579 | 549 | text = render_to_string(template, kwargs, kwargs["request"]) |
|
0 commit comments