Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
53ace96d
Commit
53ace96d
authored
Sep 06, 2014
by
Chris Reffett
Browse files
Don't try to send email if email host/port undefined
parent
18c4be9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
go/go/views.py
View file @
53ace96d
...
...
@@ -227,11 +227,13 @@ def signup(request):
full_name
=
signup_form
.
cleaned_data
.
get
(
'full_name'
)
description
=
signup_form
.
cleaned_data
.
get
(
'description'
)
send_mail
(
'Signup from %s'
%
(
username
),
'%s signed up at %s
\n
'
'Username: %s
\n
Message: %s
\n
Please attend to this request at '
'your earliest convenience.'
%
(
str
(
full_name
),
str
(
timezone
.
now
()).
strip
(),
str
(
username
),
str
(
description
)),
settings
.
EMAIL_FROM
,
[
settings
.
EMAIL_TO
])
# Only send mail if we've defined the mailserver
if
settings
.
EMAIL_HOST
and
settings
.
EMAIL_PORT
:
send_mail
(
'Signup from %s'
%
(
username
),
'%s signed up at %s
\n
'
'Username: %s
\n
Message: %s
\n
Please attend to this request at '
'your earliest convenience.'
%
(
str
(
full_name
),
str
(
timezone
.
now
()).
strip
(),
str
(
username
),
str
(
description
)),
settings
.
EMAIL_FROM
,
[
settings
.
EMAIL_TO
])
signup_form
.
save
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment