SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
SciPost
SciPost
Commits
17ea1bc0
Commit
17ea1bc0
authored
1 year ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
add preexisting options in appraisal form
parent
ab11c767
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost_django/submissions/forms/appraisal.py
+26
-0
26 additions, 0 deletions
scipost_django/submissions/forms/appraisal.py
with
26 additions
and
0 deletions
scipost_django/submissions/forms/appraisal.py
+
26
−
0
View file @
17ea1bc0
...
@@ -109,7 +109,33 @@ class RadioAppraisalForm(forms.Form):
...
@@ -109,7 +109,33 @@ class RadioAppraisalForm(forms.Form):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
submission
=
kwargs
.
pop
(
"
submission
"
)
self
.
submission
=
kwargs
.
pop
(
"
submission
"
)
self
.
fellow
=
kwargs
.
pop
(
"
fellow
"
)
self
.
fellow
=
kwargs
.
pop
(
"
fellow
"
)
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
# Add any pre-existing choices to the form
qualification
=
Qualification
.
objects
.
filter
(
submission
=
self
.
submission
,
fellow
=
self
.
fellow
).
first
()
if
qualification
and
qualification
.
expertise_level
not
in
dict
(
self
.
fields
[
"
expertise_level
"
].
choices
):
self
.
fields
[
"
expertise_level
"
].
choices
+=
(
(
qualification
.
expertise_level
,
qualification
.
get_expertise_level_display
(),
),
)
self
.
initial
[
"
expertise_level
"
]
=
qualification
.
expertise_level
readiness
=
Readiness
.
objects
.
filter
(
submission
=
self
.
submission
,
fellow
=
self
.
fellow
).
first
()
if
readiness
and
readiness
.
status
not
in
dict
(
self
.
fields
[
"
readiness
"
].
choices
):
self
.
fields
[
"
readiness
"
].
choices
+=
(
(
readiness
.
status
,
readiness
.
get_status_display
()),
)
self
.
initial
[
"
readiness
"
]
=
readiness
.
status
self
.
helper
=
FormHelper
()
self
.
helper
=
FormHelper
()
self
.
helper
.
layout
=
Layout
(
self
.
helper
.
layout
=
Layout
(
Div
(
Div
(
...
...
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