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
353ebab0
Commit
353ebab0
authored
6 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Make activation email work using DirectMailUtil
parent
d2248cb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
organizations/views.py
+5
-9
5 additions, 9 deletions
organizations/views.py
with
5 additions
and
9 deletions
organizations/views.py
+
5
−
9
View file @
353ebab0
...
...
@@ -19,7 +19,7 @@ from .forms import NewContactForm, ContactActivationForm
from
.models
import
Organization
,
Contact
from
funders.models
import
Funder
from
mails.
view
s
import
MailEditingSubView
from
mails.
util
s
import
DirectMailUtil
from
organizations.decorators
import
has_contact
from
partners.models
import
ProspectivePartner
,
Partner
...
...
@@ -109,16 +109,12 @@ def organization_add_contact(request, organization_id):
form
=
NewContactForm
(
request
.
POST
or
None
,
organization
=
organization
)
if
form
.
is_valid
():
contact
=
form
.
save
(
current_user
=
request
.
user
)
mail_request
=
MailEditingSubView
(
request
,
mail_sender
=
DirectMailUtil
(
mail_code
=
'
org_contacts/email_contact_for_activation
'
,
contact
=
contact
)
if
mail_request
.
is_valid
():
mail_request
.
send
()
messages
.
success
(
request
,
'
<h3>Created contact: %s</h3>Email has been sent.
'
%
str
(
contact
))
else
:
messages
.
warning
(
request
,
'
The mail request was not valid.
'
)
mail_sender
.
send
()
messages
.
success
(
request
,
'
<h3>Created contact: %s</h3>Email has been sent.
'
%
str
(
contact
))
return
redirect
(
reverse
(
'
organizations:organization_details
'
,
kwargs
=
{
'
pk
'
:
organization
.
id
}))
context
=
{
...
...
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