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
d83854b2
Commit
d83854b2
authored
6 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
GH-858: Handle the progression of the submissions
parent
a6e3e518
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
opentech/apply/funds/forms.py
+6
-0
6 additions, 0 deletions
opentech/apply/funds/forms.py
opentech/apply/funds/views.py
+6
-2
6 additions, 2 deletions
opentech/apply/funds/views.py
with
12 additions
and
2 deletions
opentech/apply/funds/forms.py
+
6
−
0
View file @
d83854b2
...
...
@@ -27,6 +27,7 @@ class ProgressSubmissionForm(forms.ModelForm):
class
BatchProgressSubmissionForm
(
forms
.
Form
):
action
=
forms
.
ChoiceField
(
label
=
'
Take action
'
)
submissions
=
forms
.
CharField
(
widget
=
forms
.
HiddenInput
())
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
user
=
kwargs
.
pop
(
'
user
'
)
...
...
@@ -34,6 +35,11 @@ class BatchProgressSubmissionForm(forms.Form):
choices
=
[(
action
,
detail
[
'
display
'
])
for
action
,
detail
in
ACTION_MAPPING
.
items
()]
self
.
fields
[
'
action
'
].
choices
=
choices
def
clean_submissions
(
self
):
value
=
self
.
cleaned_data
[
'
submissions
'
]
submission_ids
=
[
int
(
submission
)
for
submission
in
value
.
split
(
'
,
'
)]
return
ApplicationSubmission
.
objects
.
filter
(
id__in
=
submission_ids
)
class
ScreeningSubmissionForm
(
forms
.
ModelForm
):
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/funds/views.py
+
6
−
2
View file @
d83854b2
...
...
@@ -27,7 +27,6 @@ from opentech.apply.activity.messaging import messenger, MESSAGES
from
opentech.apply.determinations.views
import
DeterminationCreateOrUpdateView
from
opentech.apply.review.views
import
ReviewContextMixin
from
opentech.apply.users.decorators
import
staff_required
from
opentech.apply.users.models
import
User
from
opentech.apply.utils.views
import
DelegateableListView
,
DelegateableView
,
ViewDispatcher
from
.differ
import
compare
...
...
@@ -133,7 +132,12 @@ class BatchProgressSubmissionView(DelegatedViewMixin, FormView):
context_name
=
'
batch_progress_form
'
def
form_valid
(
self
,
form
):
print
(
'
wooooop
'
)
submissions
=
form
.
cleaned_data
[
'
submissions
'
]
action
=
form
.
cleaned_data
.
get
(
'
action
'
)
for
submission
in
submissions
:
self
.
submission
.
perform_transition
(
action
,
self
.
request
.
user
,
request
=
self
.
request
)
return
super
().
form_valid
(
form
)
...
...
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