Skip to content

Commit

Permalink
Merge pull request #2893 from HyphaApp/maintenance/email_template_reorg
Browse files Browse the repository at this point in the history
Move confirmation mail template to where all other mail templates are…
  • Loading branch information
frjo authored Jun 30, 2022
2 parents e19d9c4 + e1625af commit 52fb79b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
10 changes: 5 additions & 5 deletions hypha/apply/activity/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def reviewers_message(reviewers):
MESSAGES.TRANSITION: 'old_phase',
MESSAGES.BATCH_TRANSITION: 'transitions',
MESSAGES.APPLICANT_EDIT: 'revision',
MESSAGES.EDIT: 'revision',
MESSAGES.EDIT_SUBMISSION: 'revision',
MESSAGES.COMMENT: 'comment',
MESSAGES.SCREENING: 'old_status',
MESSAGES.REVIEW_OPINION: 'opinion',
Expand Down Expand Up @@ -240,7 +240,7 @@ class ActivityAdapter(AdapterBase):
MESSAGES.TRANSITION: 'handle_transition',
MESSAGES.BATCH_TRANSITION: 'handle_batch_transition',
MESSAGES.NEW_SUBMISSION: _('Submitted {source.title} for {source.page.title}'),
MESSAGES.EDIT: _('Edited'),
MESSAGES.EDIT_SUBMISSION: _('Edited'),
MESSAGES.APPLICANT_EDIT: _('Edited'),
MESSAGES.UPDATE_LEAD: _('Lead changed from {old_lead} to {source.lead}'),
MESSAGES.BATCH_UPDATE_LEAD: _('Batch Lead changed to {new_lead}'),
Expand Down Expand Up @@ -431,7 +431,7 @@ class SlackAdapter(AdapterBase):
MESSAGES.UPDATE_LEAD: _('The lead of <{link}|{source.title}> has been updated from {old_lead} to {source.lead} by {user}'),
MESSAGES.BATCH_UPDATE_LEAD: 'handle_batch_lead',
MESSAGES.COMMENT: _('A new {comment.visibility} comment has been posted on <{link}|{source.title}> by {user}'),
MESSAGES.EDIT: _('{user} has edited <{link}|{source.title}>'),
MESSAGES.EDIT_SUBMISSION: _('{user} has edited <{link}|{source.title}>'),
MESSAGES.APPLICANT_EDIT: _('{user} has edited <{link}|{source.title}>'),
MESSAGES.REVIEWERS_UPDATED: 'reviewers_updated',
MESSAGES.BATCH_REVIEWERS_UPDATED: 'handle_batch_reviewers',
Expand Down Expand Up @@ -741,9 +741,9 @@ def send_message(self, message, recipient, source, **kwargs):
class EmailAdapter(AdapterBase):
adapter_type = 'Email'
messages = {
MESSAGES.NEW_SUBMISSION: 'funds/email/confirmation.html',
MESSAGES.NEW_SUBMISSION: 'messages/email/submission_confirmation.html',
MESSAGES.COMMENT: 'notify_comment',
MESSAGES.EDIT: 'messages/email/edit.html',
MESSAGES.EDIT_SUBMISSION: 'messages/email/submission_edit.html',
MESSAGES.TRANSITION: 'handle_transition',
MESSAGES.BATCH_TRANSITION: 'handle_batch_transition',
MESSAGES.DETERMINATION_OUTCOME: 'handle_determination',
Expand Down
18 changes: 18 additions & 0 deletions hypha/apply/activity/migrations/0063_alter_event_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.13 on 2022-06-21 07:41

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('activity', '0062_remove_payment_requests_activities'),
]

operations = [
migrations.AlterField(
model_name='event',
name='type',
field=models.CharField(choices=[('UPDATE_LEAD', 'Update Lead'), ('BATCH_UPDATE_LEAD', 'Batch Update Lead'), ('EDIT_SUBMISSION', 'Edit'), ('APPLICANT_EDIT', 'Applicant Edit'), ('NEW_SUBMISSION', 'New Submission'), ('SCREENING', 'Screening'), ('TRANSITION', 'Transition'), ('BATCH_TRANSITION', 'Batch Transition'), ('DETERMINATION_OUTCOME', 'Determination Outcome'), ('BATCH_DETERMINATION_OUTCOME', 'Batch Determination Outcome'), ('INVITED_TO_PROPOSAL', 'Invited To Proposal'), ('REVIEWERS_UPDATED', 'Reviewers Updated'), ('BATCH_REVIEWERS_UPDATED', 'Batch Reviewers Updated'), ('PARTNERS_UPDATED', 'Partners Updated'), ('PARTNERS_UPDATED_PARTNER', 'Partners Updated Partner'), ('READY_FOR_REVIEW', 'Ready For Review'), ('BATCH_READY_FOR_REVIEW', 'Batch Ready For Review'), ('NEW_REVIEW', 'New Review'), ('COMMENT', 'Comment'), ('PROPOSAL_SUBMITTED', 'Proposal Submitted'), ('OPENED_SEALED', 'Opened Sealed Submission'), ('REVIEW_OPINION', 'Review Opinion'), ('DELETE_SUBMISSION', 'Delete Submission'), ('DELETE_REVIEW', 'Delete Review'), ('CREATED_PROJECT', 'Created Project'), ('UPDATED_VENDOR', 'Updated Contracting information'), ('UPDATE_PROJECT_LEAD', 'Update Project Lead'), ('EDIT_REVIEW', 'Edit Review'), ('SEND_FOR_APPROVAL', 'Send for Approval'), ('APPROVE_PROJECT', 'Project was Approved'), ('PROJECT_TRANSITION', 'Project was Transitioned'), ('REQUEST_PROJECT_CHANGE', 'Project change requested'), ('UPLOAD_DOCUMENT', 'Document was Uploaded to Project'), ('REMOVE_DOCUMENT', 'Document was Removed from Project'), ('UPLOAD_CONTRACT', 'Contract was Uploaded to Project'), ('APPROVE_CONTRACT', 'Contract was Approved'), ('CREATE_INVOICE', 'Invoice was created for Project'), ('UPDATE_INVOICE_STATUS', 'Updated Invoice Status'), ('DELETE_INVOICE', 'Delete Invoice'), ('SENT_TO_COMPLIANCE', 'Project was sent to Compliance'), ('UPDATE_INVOICE', 'Updated Invoice'), ('SUBMIT_REPORT', 'Submit Report'), ('SKIPPED_REPORT', 'Skipped Report'), ('REPORT_FREQUENCY_CHANGED', 'Report Frequency Changed'), ('REPORT_NOTIFY', 'Report Notify'), ('CREATE_REMINDER', 'Reminder Created'), ('DELETE_REMINDER', 'Reminder Deleted'), ('REVIEW_REMINDER', 'Reminder to Review'), ('BATCH_DELETE_SUBMISSION', 'Delete Batch Submissions')], max_length=50),
),
]
4 changes: 2 additions & 2 deletions hypha/apply/activity/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class MESSAGES(Enum):
UPDATE_LEAD = 'Update Lead'
BATCH_UPDATE_LEAD = 'Batch Update Lead'
EDIT = 'Edit'
EDIT_SUBMISSION = 'Edit'
APPLICANT_EDIT = "Applicant Edit"
NEW_SUBMISSION = 'New Submission'
SCREENING = 'Screening'
Expand Down Expand Up @@ -49,7 +49,7 @@ class MESSAGES(Enum):
REPORT_NOTIFY = 'Report Notify'
CREATE_REMINDER = 'Reminder Created'
DELETE_REMINDER = 'Reminder Deleted'
REVIEW_REMINDER = 'Reminde to Review'
REVIEW_REMINDER = 'Reminder to Review'
BATCH_DELETE_SUBMISSION = 'Delete Batch Submissions'

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/funds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ def form_valid(self, form):
revision = self.object.create_revision(by=self.request.user)
if revision:
messenger(
MESSAGES.EDIT,
MESSAGES.EDIT_SUBMISSION,
request=self.request,
user=self.request.user,
source=self.object,
Expand Down

0 comments on commit 52fb79b

Please sign in to comment.