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
eabe983c
Commit
eabe983c
authored
7 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Fix errors introduced by the rebase
parent
e166d9e2
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
opentech/apply/funds/models.py
+19
-1
19 additions, 1 deletion
opentech/apply/funds/models.py
with
19 additions
and
1 deletion
opentech/apply/funds/models.py
+
19
−
1
View file @
eabe983c
...
@@ -7,8 +7,8 @@ from django.core.serializers.json import DjangoJSONEncoder
...
@@ -7,8 +7,8 @@ from django.core.serializers.json import DjangoJSONEncoder
from
django.db
import
models
from
django.db
import
models
from
django.db.models
import
Q
from
django.db.models
import
Q
from
django.db.models.expressions
import
RawSQL
,
OrderBy
from
django.db.models.expressions
import
RawSQL
,
OrderBy
from
django.db.utils
import
IntegrityError
from
django.http
import
Http404
from
django.http
import
Http404
from
django.template.loader
import
render_to_string
from
django.urls
import
reverse
from
django.urls
import
reverse
from
django.utils.text
import
mark_safe
from
django.utils.text
import
mark_safe
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
...
@@ -24,6 +24,7 @@ from wagtail.wagtailadmin.edit_handlers import (
...
@@ -24,6 +24,7 @@ from wagtail.wagtailadmin.edit_handlers import (
TabbedInterface
TabbedInterface
)
)
from
wagtail.wagtailadmin.utils
import
send_mail
from
wagtail.wagtailcore.fields
import
StreamField
from
wagtail.wagtailcore.fields
import
StreamField
from
wagtail.wagtailcore.models
import
Orderable
,
Page
from
wagtail.wagtailcore.models
import
Orderable
,
Page
from
wagtail.wagtailforms.models
import
AbstractEmailForm
,
AbstractFormSubmission
from
wagtail.wagtailforms.models
import
AbstractEmailForm
,
AbstractFormSubmission
...
@@ -106,6 +107,19 @@ class DefinableWorkflowStreamForm(AbstractEmailForm, AbstractStreamForm):
...
@@ -106,6 +107,19 @@ class DefinableWorkflowStreamForm(AbstractEmailForm, AbstractStreamForm):
def
workflow_class
(
self
):
def
workflow_class
(
self
):
return
WORKFLOW_CLASS
[
self
.
get_workflow_display
()]
return
WORKFLOW_CLASS
[
self
.
get_workflow_display
()]
def
send_confirmation_email
(
self
,
form
,
cleaned_data
):
email
=
cleaned_data
.
get
(
'
email
'
)
context
=
{
'
name
'
:
cleaned_data
.
get
(
'
full_name
'
),
'
email
'
:
email
,
'
project_name
'
:
cleaned_data
.
get
(
'
title
'
),
'
extra_text
'
:
self
.
confirmation_text_extra
,
'
fund_type
'
:
self
.
title
,
}
subject
=
self
.
subject
if
self
.
subject
else
'
Thank You for Your submission to Open Technology Fund
'
send_mail
(
subject
,
render_to_string
(
'
funds/email/confirmation.txt
'
,
context
),
(
email
,),
self
.
from_address
,
)
content_panels
=
AbstractStreamForm
.
content_panels
+
[
content_panels
=
AbstractStreamForm
.
content_panels
+
[
FieldPanel
(
'
workflow
'
),
FieldPanel
(
'
workflow
'
),
InlinePanel
(
'
forms
'
,
label
=
"
Forms
"
),
InlinePanel
(
'
forms
'
,
label
=
"
Forms
"
),
...
@@ -210,6 +224,10 @@ class Round(SubmittableStreamForm):
...
@@ -210,6 +224,10 @@ class Round(SubmittableStreamForm):
**
kwargs
,
**
kwargs
,
)
)
def
send_confirmation_email
(
self
,
form
,
cleaned_data
):
# Parent holds the configuration about emails
self
.
get_parent
().
specific
.
send_confirmation_email
(
form
,
cleaned_data
)
def
get_defined_fields
(
self
):
def
get_defined_fields
(
self
):
# Only return the first form, will need updating for when working with 2 stage WF
# Only return the first form, will need updating for when working with 2 stage WF
return
self
.
get_parent
().
specific
.
forms
.
all
()[
0
].
fields
return
self
.
get_parent
().
specific
.
forms
.
all
()[
0
].
fields
...
...
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