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
ca54336a
Commit
ca54336a
authored
7 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Fix linting errors
parent
a3d34809
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
opentech/apply/blocks.py
+7
-4
7 additions, 4 deletions
opentech/apply/blocks.py
opentech/apply/forms.py
+1
-2
1 addition, 2 deletions
opentech/apply/forms.py
opentech/apply/models.py
+1
-1
1 addition, 1 deletion
opentech/apply/models.py
with
9 additions
and
7 deletions
opentech/apply/blocks.py
+
7
−
4
View file @
ca54336a
...
@@ -32,7 +32,7 @@ class CategoryQuestionBlock(FormFieldBlock):
...
@@ -32,7 +32,7 @@ class CategoryQuestionBlock(FormFieldBlock):
def
get_field_kwargs
(
self
,
struct_value
):
def
get_field_kwargs
(
self
,
struct_value
):
kwargs
=
super
().
get_field_kwargs
(
struct_value
)
kwargs
=
super
().
get_field_kwargs
(
struct_value
)
category
=
struct_value
[
'
category
'
]
category
=
struct_value
[
'
category
'
]
choices
=
category
.
options
.
values_list
(
'
id
'
,
'
value
'
)
choices
=
category
.
options
.
values_list
(
'
id
'
,
'
value
'
)
kwargs
.
update
({
'
choices
'
:
choices
})
kwargs
.
update
({
'
choices
'
:
choices
})
return
kwargs
return
kwargs
...
@@ -47,8 +47,11 @@ class CategoryQuestionBlock(FormFieldBlock):
...
@@ -47,8 +47,11 @@ class CategoryQuestionBlock(FormFieldBlock):
class
CustomFormFieldsBlock
(
FormFieldsBlock
):
class
CustomFormFieldsBlock
(
FormFieldsBlock
):
category
=
CategoryQuestionBlock
(
group
=
_
(
'
Custom
'
))
category
=
CategoryQuestionBlock
(
group
=
_
(
'
Custom
'
))
class
FormsBlock
(
StreamBlock
):
class
FormsBlock
(
StreamBlock
):
form
=
StructBlock
([
form
=
StructBlock
([
(
'
form
'
,
StaticBlock
(
admin_text
=
'
Please add additional fields to this form or create an additional form below
'
)),
(
'
form
'
,
StaticBlock
(
(
'
fields
'
,
CustomFormFieldsBlock
()),
admin_text
=
'
Please add additional fields to this form or create an additional form below
'
,
])
)),
(
'
fields
'
,
CustomFormFieldsBlock
()),
])
This diff is collapsed.
Click to expand it.
opentech/apply/forms.py
+
1
−
2
View file @
ca54336a
from
django
import
forms
from
wagtail.wagtailadmin.forms
import
WagtailAdminPageForm
from
wagtail.wagtailadmin.forms
import
WagtailAdminPageForm
...
@@ -6,7 +5,7 @@ class WorkflowFormAdminForm(WagtailAdminPageForm):
...
@@ -6,7 +5,7 @@ class WorkflowFormAdminForm(WagtailAdminPageForm):
def
clean
(
self
):
def
clean
(
self
):
cleaned_data
=
super
().
clean
()
cleaned_data
=
super
().
clean
()
model
=
self
.
_meta
.
model
model
=
self
.
_meta
.
model
from
.models
import
WORKFLOW_CLASS
from
.models
import
WORKFLOW_CLASS
workflow
=
WORKFLOW_CLASS
[
model
.
WORKFLOWS
[
cleaned_data
[
'
workflow
'
]]]
workflow
=
WORKFLOW_CLASS
[
model
.
WORKFLOWS
[
cleaned_data
[
'
workflow
'
]]]
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/models.py
+
1
−
1
View file @
ca54336a
...
@@ -24,7 +24,7 @@ WORKFLOW_CLASS = {
...
@@ -24,7 +24,7 @@ WORKFLOW_CLASS = {
}
}
class
ApplyHomePage
(
Page
,
SocialFields
,
ListingFields
):
class
ApplyHomePage
(
Page
,
SocialFields
,
ListingFields
):
# type: ignore
# Only allow creating HomePages at the root level
# Only allow creating HomePages at the root level
parent_page_types
=
[
'
wagtailcore.Page
'
]
parent_page_types
=
[
'
wagtailcore.Page
'
]
...
...
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