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
0272dcef
Commit
0272dcef
authored
6 years ago
by
Dan Braghis
Browse files
Options
Downloads
Patches
Plain Diff
Clean up the use of progress_stage
parent
c98aa5a8
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
+5
-6
5 additions, 6 deletions
opentech/apply/determinations/views.py
opentech/apply/funds/models.py
+2
-0
2 additions, 0 deletions
opentech/apply/funds/models.py
with
7 additions
and
6 deletions
opentech/apply/determinations/views.py
+
5
−
6
View file @
0272dcef
...
@@ -83,12 +83,11 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView):
...
@@ -83,12 +83,11 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView):
return
self
.
progress_stage
(
self
.
submission
)
or
response
return
self
.
progress_stage
(
self
.
submission
)
or
response
def
progress_stage
(
self
,
instance
):
def
progress_stage
(
self
,
instance
):
# TODO update post-revisions work
try
:
proposal_transition
=
instance
.
get_transition
(
'
draft_proposal
'
)
instance
.
perform_transition
(
'
draft_proposal
'
,
self
.
request
.
user
)
if
proposal_transition
:
except
PermissionDenied
:
if
can_proceed
(
proposal_transition
):
pass
proposal_transition
(
by
=
self
.
request
.
user
)
else
:
instance
.
save
()
return
HttpResponseRedirect
(
instance
.
get_absolute_url
())
return
HttpResponseRedirect
(
instance
.
get_absolute_url
())
def
get_action_name_from_determination
(
self
,
determination
):
def
get_action_name_from_determination
(
self
,
determination
):
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/funds/models.py
+
2
−
0
View file @
0272dcef
...
@@ -585,6 +585,8 @@ class AddTransitions(models.base.ModelBase):
...
@@ -585,6 +585,8 @@ class AddTransitions(models.base.ModelBase):
def
perform_transition
(
self
,
action
,
user
):
def
perform_transition
(
self
,
action
,
user
):
transition
=
self
.
get_transition
(
action
)
transition
=
self
.
get_transition
(
action
)
if
not
transition
:
raise
PermissionDenied
(
f
'
Invalid
"
{
action
}
"
transition
'
)
if
not
can_proceed
(
transition
):
if
not
can_proceed
(
transition
):
action
=
self
.
phase
.
transitions
[
action
]
action
=
self
.
phase
.
transitions
[
action
]
raise
PermissionDenied
(
f
'
You do not have permission to
"
{
action
}
"'
)
raise
PermissionDenied
(
f
'
You do not have permission to
"
{
action
}
"'
)
...
...
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