Skip to content

Commit 3435052

Browse files
authored
Remove partner role (#4790)
<!-- Thanks for contributing to Hypha! Please ensure your contributions pass all necessary linting/testing and that the appropriate documentation has been updated. --> <!-- Describe briefly what your pull request changes. If this is resolving an issue, please specify below via "Fixes #<Github Issue ID>" --> Closes #4719. Migrates all existing partners to coapplicants with comment privileges and removes the partner role from Hypha. This also handles swapping partner comment visibility to applicant ## Test Steps <!-- If step does not require manual testing, skip/remove this section. Give a brief overview of the steps required for a user/dev to test this contribution. Important things to include: - Required user roles for where necessary (ie. "As a Staff Admin...") - Clear & validatable expected results (ie. "Confirm the submit button is now not clickable") - Language that can be understood by non-technical testers if being tested by users --> - [ ] All partner views are removed (update partner, add partner, etc) - [ ] Comment visibility options show up as expected **After migrations are ran confirm...** - [ ] all active partners are coapplicants w/ comment privileges - [ ] the partner role is removed from Hypha - [ ] activity visibility that previously specified partners (ie. `partners` or `applicant partners`) are now `applicant`
1 parent b361f8a commit 3435052

49 files changed

Lines changed: 229 additions & 634 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ A clear and concise description of what you expected to happen.
4848
- Staff
4949
- Applicants
5050
- Reviewers
51-
- Partners
5251
- Developers
5352
- General public
5453

.github/ISSUE_TEMPLATE/enhancement-request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Add any other context or screenshots about the feature request here.
5050
- Staff
5151
- Applicants
5252
- Reviewers
53-
- Partners
5453
- Developers
5554
- General public
5655

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Add any other context or screenshots about the feature request here.
5050
- Staff
5151
- Applicants
5252
- Reviewers
53-
- Partners
5453
- Developers
5554
- General public
5655

.github/ISSUE_TEMPLATE/scoping_review_form.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Add any other context or screenshots about the feature request here.
3838
- Staff
3939
- Applicants
4040
- Reviewers
41-
- Partners
4241
- Developers
4342
- General public
4443

docs/references/glossary.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,5 @@
6666
**Approver**
6767
: an individual, usually member of staff, who can authorize a contract or payment request
6868

69-
**Partner**
70-
: For OTF, in the application phase, "partner" could view the application but is unable to submit a review and could submit payment requests. This role can see, edit, and communicate about a specific application.
71-
7269
**Finance**
7370
: role for staff with finance related functions. In Hypha they have dashboard to enable approval of invoices.

docs/references/user-roles.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ For example, system administrators could adjust the administrative access or per
1212
Hypha comes with the following user roles that has special permissions:
1313

1414
- [Staff](#staff)
15-
- [Partner](#partner)
1615
- [Reviewer](#reviewer)
1716
- [Applicant](#applicant)
1817
- [Additional roles](#additional-roles)
@@ -28,34 +27,13 @@ Staff can:
2827
* Modify roles for other users
2928
* Set up applications (this means creating Forms, Funds, and Rounds
3029
* View applications/submissions
31-
* Give other users (ie Reviewers, Partners) access to submissions
30+
* Give other users (ie. Reviewers, Co-Applicants) access to submissions
3231
* Review submissions
3332
* Draft and send correspondence
3433
* Write a comment to applicants and other users on the platform
3534

3635
Account created by **Staff** & assigned to either "Fund" or specific application(s)
3736

38-
## Partner
39-
40-
The **Partner** role could be access, edit, and communicate about a specific application they are assigned to. This role could be accessed when two or more people are working together on a single application; one applicant gets **Applicant** role, and additional applicants get this role. OTF use the partner role for fellowship host organizations, service providers, etc.
41-
42-
A **Partner can**:
43-
44-
* View, edit, and communicate about a specific application
45-
* Used when two or more people are working together on an application; one applicant gets **Applicant** role, and additional applicants get this role
46-
47-
> ℹ️ _This role is created by Staff and associated with a specific application_
48-
49-
The **Partner** role could be access, edit, and communicate about a specific application they are assigned to. OTF use the partner role for fellowship host organizations, service providers, etc.
50-
51-
The Partner could only review applications that has been assigned to them. Applications assigned to the Partner are available on their dashboard.
52-
53-
![](../assets/partner_dashboard_assign_submission.png)
54-
55-
The Partner role could be associated or assigned to an application by clicking on Partner button in the **Actions to take** > Assign.
56-
57-
![](../assets/submission_how-to-assign-partner.png)
58-
5937
## Reviewer
6038

6139
The **Reviewer** role has their own dashboard and can submit reviews. OTF's Advisory Council Members are often assigned the 'Reviewer' role.

docs/setup/administrators/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Staff e-mail domain. Used for OAUTH2 whitelist default value and staff account c
219219

220220
----
221221

222-
Should staff identities be obscured from Applicants & Partners (ie. comments will be ORG_LONG_NAME rather than "John Doe").
222+
Should staff identities be obscured from Applicants (ie. comments will be ORG_LONG_NAME rather than "John Doe").
223223

224224
HIDE_STAFF_IDENTITY = env.bool('HIDE_STAFF_IDENTITY', False)
225225

docs/user-guides/creating-a-user-account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The "Add User" form will request your email, name, and role within the platform.
2828

2929
![](../assets/manage_user-add-user.jpg)
3030

31-
Selecting a role with enable to administrative access within the platform. Commonly used roles within the platform are **Staff**, **Partner**, and **Reviewer**.
31+
Selecting a role with enable to administrative access within the platform. Commonly used roles within the platform are **Staff** and **Reviewer**.
3232

3333
![](../assets/manage_user-update-group.jpg)
3434

hypha/apply/activity/adapters/activity_feed.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class ActivityAdapter(AdapterBase):
3838
MESSAGES.INVITED_TO_PROPOSAL: _("Invited to submit a proposal"),
3939
MESSAGES.REVIEWERS_UPDATED: "reviewers_updated",
4040
MESSAGES.BATCH_REVIEWERS_UPDATED: "batch_reviewers_updated",
41-
MESSAGES.PARTNERS_UPDATED: "partners_updated",
4241
MESSAGES.NEW_REVIEW: _("Submitted a review"),
4342
MESSAGES.OPENED_SEALED: _("Opened the submission while still sealed"),
4443
MESSAGES.SCREENING: "handle_screening_statuses",
@@ -89,7 +88,6 @@ def extra_kwargs(self, message_type, source, sources, **kwargs):
8988
MESSAGES.REVIEW_OPINION,
9089
MESSAGES.DELETE_REVIEW_OPINION,
9190
MESSAGES.BATCH_REVIEWERS_UPDATED,
92-
MESSAGES.PARTNERS_UPDATED,
9391
MESSAGES.APPROVE_PROJECT,
9492
MESSAGES.REQUEST_PROJECT_CHANGE,
9593
MESSAGES.SEND_FOR_APPROVAL,
@@ -287,18 +285,6 @@ def handle_batch_transition(self, transitions, sources, **kwargs):
287285
old_phase=old_phase, source=submission, **kwargs
288286
)
289287

290-
def partners_updated(self, added, removed, **kwargs):
291-
message = [_("Partners updated.")]
292-
if added:
293-
message.append(_("Added:"))
294-
message.append(", ".join([str(user) for user in added]) + ".")
295-
296-
if removed:
297-
message.append(_("Removed:"))
298-
message.append(", ".join([str(user) for user in removed]) + ".")
299-
300-
return " ".join(message)
301-
302288
def handle_report_frequency(self, config, **kwargs):
303289
new_schedule = config.get_frequency_display()
304290
return _(

hypha/apply/activity/adapters/emails.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from django.utils.translation import gettext as _
1010

1111
from hypha.apply.activity import tasks
12-
from hypha.apply.activity.models import ALL, APPLICANT_PARTNERS, PARTNER
1312
from hypha.apply.funds.models.co_applicants import (
1413
CoApplicantProjectPermission,
1514
CoApplicantRole,
@@ -65,8 +64,6 @@ class EmailAdapter(AdapterBase):
6564
MESSAGES.READY_FOR_REVIEW: "handle_ready_for_review",
6665
MESSAGES.REVIEWERS_UPDATED: "handle_ready_for_review",
6766
MESSAGES.BATCH_REVIEWERS_UPDATED: "handle_batch_ready_for_review",
68-
MESSAGES.PARTNERS_UPDATED: "partners_updated_applicant",
69-
MESSAGES.PARTNERS_UPDATED_PARTNER: "partners_updated_partner",
7067
MESSAGES.UPLOAD_CONTRACT: "messages/email/contract_uploaded.html",
7168
MESSAGES.SUBMIT_CONTRACT_DOCUMENTS: "messages/email/submit_contract_documents.html",
7269
MESSAGES.CREATED_PROJECT: "messages/email/project_created.html",
@@ -328,10 +325,6 @@ def recipients(self, message_type, source, user, **kwargs):
328325
related = kwargs.get("related", None)
329326
return [related.invited_user_email]
330327

331-
if message_type == MESSAGES.PARTNERS_UPDATED_PARTNER:
332-
partners = kwargs["added"]
333-
return [partner.email for partner in partners]
334-
335328
if message_type == MESSAGES.APPROVE_PAF:
336329
from hypha.apply.projects.models.project import ProjectSettings
337330

@@ -488,12 +481,6 @@ def recipients(self, message_type, source, user, **kwargs):
488481
).values_list("user__email", flat=True)
489482
recipients: List[str] = [source.user.email, *co_applicants]
490483

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-
497484
# Comment handling for Projects
498485
elif isinstance(source, Project):
499486
# co_applciants with Comment permission
@@ -557,23 +544,6 @@ def reviewers(self, source):
557544
and not reviewer.is_apply_staff
558545
]
559546

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-
577547
def render_message(self, template, **kwargs):
578548
with language(settings.LANGUAGE_CODE):
579549
text = render_to_string(template, kwargs, kwargs["request"])

0 commit comments

Comments
 (0)