Skip to content
Snippets Groups Projects
Commit b19b8407 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Add hook for comments

parent 004cc4ad
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ class MESSAGES(Enum): ...@@ -12,6 +12,7 @@ class MESSAGES(Enum):
DETERMINATION_OUTCOME = 'determination_outcome' DETERMINATION_OUTCOME = 'determination_outcome'
INVITED_TO_PROPOSAL = 'invited_to_proposal' INVITED_TO_PROPOSAL = 'invited_to_proposal'
REVIEWERS_UPDATED = 'reviewers_updated' REVIEWERS_UPDATED = 'reviewers_updated'
COMMENT = 'comment'
class MessageAdapter: class MessageAdapter:
......
...@@ -3,6 +3,7 @@ from django.views.generic import CreateView ...@@ -3,6 +3,7 @@ from django.views.generic import CreateView
from opentech.apply.utils.views import DelegatedViewMixin from opentech.apply.utils.views import DelegatedViewMixin
from .forms import CommentForm from .forms import CommentForm
from .messaging import messenger, MESSAGES
from .models import Activity, COMMENT from .models import Activity, COMMENT
...@@ -37,6 +38,12 @@ class CommentFormView(DelegatedViewMixin, CreateView): ...@@ -37,6 +38,12 @@ class CommentFormView(DelegatedViewMixin, CreateView):
form.instance.user = self.request.user form.instance.user = self.request.user
form.instance.submission = self.kwargs['submission'] form.instance.submission = self.kwargs['submission']
form.instance.type = COMMENT form.instance.type = COMMENT
messenger(
MESSAGES.COMMENT,
user=self.request.user,
submission=self.submission,
comment=form.instance,
)
return super().form_valid(form) return super().form_valid(form)
def get_success_url(self): def get_success_url(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment