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
46788ca2
Commit
46788ca2
authored
6 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Patches
Plain Diff
Fix
parent
dcd61dc4
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
mails/forms.py
+4
-6
4 additions, 6 deletions
mails/forms.py
with
4 additions
and
6 deletions
mails/forms.py
+
4
−
6
View file @
46788ca2
...
...
@@ -19,7 +19,8 @@ class EmailTemplateForm(forms.Form, MailUtilsMixin):
# This form shouldn't be is_bound==True is there is any non-relavant POST data given.
data
=
args
[
0
]
if
args
else
{}
data
=
kwargs
[
'
data
'
]
if
'
data
'
in
kwargs
else
data
if
not
data
:
data
=
{}
if
'
%s-subject
'
%
self
.
prefix
in
data
.
keys
():
data
=
{
'
%s-subject
'
%
self
.
prefix
:
data
.
get
(
'
%s-subject
'
%
self
.
prefix
),
...
...
@@ -30,7 +31,7 @@ class EmailTemplateForm(forms.Form, MailUtilsMixin):
data
=
None
super
().
__init__
(
data
or
None
)
if
self
.
original_recipient
==
''
:
if
not
self
.
original_recipient
:
self
.
fields
[
'
extra_recipient
'
].
label
=
"
Send this email to
"
self
.
fields
[
'
extra_recipient
'
].
required
=
True
...
...
@@ -50,7 +51,7 @@ class EmailTemplateForm(forms.Form, MailUtilsMixin):
self
.
bcc_list
.
append
(
self
.
cleaned_data
.
get
(
'
extra_recipient
'
))
elif
self
.
cleaned_data
.
get
(
'
extra_recipient
'
)
and
not
self
.
original_recipient
:
self
.
original_recipient
=
[
self
.
cleaned_data
.
get
(
'
extra_recipient
'
)]
elif
self
.
original_recipient
==
''
:
elif
not
self
.
original_recipient
:
self
.
add_error
(
'
extra_recipient
'
,
'
Please fill the bcc field to send the mail.
'
)
self
.
validate_recipients
()
...
...
@@ -61,9 +62,6 @@ class EmailTemplateForm(forms.Form, MailUtilsMixin):
self
.
save_data
()
return
data
def
save
(
self
):
return
self
.
instance
class
HiddenDataForm
(
forms
.
Form
):
def
__init__
(
self
,
form
,
*
args
,
**
kwargs
):
...
...
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