Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
e92af7e5
Commit
e92af7e5
authored
6 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Refactor the messaging to send less messages
parent
32457d38
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
opentech/apply/determinations/views.py
+1
-1
1 addition, 1 deletion
opentech/apply/determinations/views.py
opentech/apply/funds/views.py
+16
-14
16 additions, 14 deletions
opentech/apply/funds/views.py
with
17 additions
and
15 deletions
opentech/apply/determinations/views.py
+
1
−
1
View file @
e92af7e5
...
@@ -97,7 +97,7 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView):
...
@@ -97,7 +97,7 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView):
submission
=
self
.
submission
,
submission
=
self
.
submission
,
)
)
self
.
submission
.
perform_transition
(
transition
,
self
.
request
.
user
,
request
=
self
.
request
)
self
.
submission
.
perform_transition
(
transition
,
self
.
request
.
user
,
request
=
self
.
request
,
notify
=
False
)
return
HttpResponseRedirect
(
self
.
submission
.
get_absolute_url
())
return
HttpResponseRedirect
(
self
.
submission
.
get_absolute_url
())
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/funds/views.py
+
16
−
14
View file @
e92af7e5
from
copy
import
copy
from
copy
import
copy
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.decorators
import
login_required
from
django.contrib
import
messages
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
from
django.http
import
HttpResponseRedirect
from
django.http
import
HttpResponseRedirect
from
django.shortcuts
import
get_object_or_404
from
django.shortcuts
import
get_object_or_404
from
django.urls
import
reverse_lazy
from
django.urls
import
reverse_lazy
from
django.utils.decorators
import
method_decorator
from
django.utils.decorators
import
method_decorator
from
django.utils.text
import
mark_safe
from
django.utils.text
import
mark_safe
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.views.generic
import
DetailView
,
ListView
,
UpdateView
from
django.views.generic
import
DetailView
,
ListView
,
UpdateView
from
django_filters.views
import
FilterView
from
django_filters.views
import
FilterView
...
@@ -28,6 +30,7 @@ from .differ import compare
...
@@ -28,6 +30,7 @@ from .differ import compare
from
.forms
import
ProgressSubmissionForm
,
UpdateReviewersForm
,
UpdateSubmissionLeadForm
from
.forms
import
ProgressSubmissionForm
,
UpdateReviewersForm
,
UpdateSubmissionLeadForm
from
.models
import
ApplicationSubmission
,
ApplicationRevision
from
.models
import
ApplicationSubmission
,
ApplicationRevision
from
.tables
import
AdminSubmissionsTable
,
SubmissionFilter
,
SubmissionFilterAndSearch
from
.tables
import
AdminSubmissionsTable
,
SubmissionFilter
,
SubmissionFilterAndSearch
from
.workflow
import
STAGE_CHANGE_ACTIONS
@method_decorator
(
staff_required
,
name
=
'
dispatch
'
)
@method_decorator
(
staff_required
,
name
=
'
dispatch
'
)
...
@@ -82,18 +85,7 @@ class ProgressSubmissionView(DelegatedViewMixin, UpdateView):
...
@@ -82,18 +85,7 @@ class ProgressSubmissionView(DelegatedViewMixin, UpdateView):
'
apply:submissions:determinations:form
'
,
'
apply:submissions:determinations:form
'
,
args
=
(
form
.
instance
.
id
,))
+
"
?action=
"
+
action
)
args
=
(
form
.
instance
.
id
,))
+
"
?action=
"
+
action
)
submitting_proposal
=
self
.
object
.
phase
.
name
==
'
proposal_draft
'
and
action
==
'
proposal_discussion
'
self
.
object
.
perform_transition
(
action
,
self
.
request
.
user
,
request
=
self
.
request
)
self
.
object
.
perform_transition
(
action
,
self
.
request
.
user
,
request
=
self
.
request
,
notify
=
not
submitting_proposal
)
if
submitting_proposal
:
messenger
(
MESSAGES
.
PROPOSAL_SUBMITTED
,
request
=
self
.
request
,
user
=
self
.
request
.
user
,
submission
=
self
.
object
.
instance
,
)
return
super
().
form_valid
(
form
)
return
super
().
form_valid
(
form
)
...
@@ -320,10 +312,20 @@ class ApplicantSubmissionEditView(BaseSubmissionEditView):
...
@@ -320,10 +312,20 @@ class ApplicantSubmissionEditView(BaseSubmissionEditView):
if
'
save
'
in
self
.
request
.
POST
:
if
'
save
'
in
self
.
request
.
POST
:
self
.
object
.
create_revision
(
draft
=
True
,
by
=
self
.
request
.
user
)
self
.
object
.
create_revision
(
draft
=
True
,
by
=
self
.
request
.
user
)
messages
.
success
(
self
.
request
,
_
(
'
Submission saved successfully
'
))
return
self
.
form_invalid
(
form
)
return
self
.
form_invalid
(
form
)
created
=
self
.
object
.
create_revision
(
by
=
self
.
request
.
user
)
created
=
self
.
object
.
create_revision
(
by
=
self
.
request
.
user
)
if
created
:
submitting_proposal
=
self
.
object
.
phase
.
name
in
STAGE_CHANGE_ACTIONS
if
submitting_proposal
:
messenger
(
MESSAGES
.
PROPOSAL_SUBMITTED
,
request
=
self
.
request
,
user
=
self
.
request
.
user
,
submission
=
self
.
object
.
instance
,
)
elif
created
:
messenger
(
messenger
(
MESSAGES
.
APPLICANT_EDIT
,
MESSAGES
.
APPLICANT_EDIT
,
request
=
self
.
request
,
request
=
self
.
request
,
...
@@ -338,7 +340,7 @@ class ApplicantSubmissionEditView(BaseSubmissionEditView):
...
@@ -338,7 +340,7 @@ class ApplicantSubmissionEditView(BaseSubmissionEditView):
transition
.
target
,
transition
.
target
,
self
.
request
.
user
,
self
.
request
.
user
,
request
=
self
.
request
,
request
=
self
.
request
,
notify
=
not
created
,
# Use the APPLICANT_EDIT
notification
notify
=
not
(
created
or
submitting_proposal
),
# Use the other
notification
)
)
return
HttpResponseRedirect
(
self
.
get_success_url
())
return
HttpResponseRedirect
(
self
.
get_success_url
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment