Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a30de002
authored
Jun 09, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add EMAIL_SUBJECT_PREFIX to notifications
parent
8bc53a3b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
circle/circle/settings/base.py
+2
-0
circle/dashboard/models.py
+1
-1
circle/dashboard/tasks/local_periodic_tasks.py
+2
-1
No files found.
circle/circle/settings/base.py
View file @
a30de002
...
@@ -79,6 +79,8 @@ ADMINS = (
...
@@ -79,6 +79,8 @@ ADMINS = (
(
'Root'
,
'root@localhost'
),
(
'Root'
,
'root@localhost'
),
)
)
EMAIL_SUBJECT_PREFIX
=
get_env_variable
(
'DJANGO_SUBJECT_PREFIX'
,
'[CIRCLE] '
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS
=
ADMINS
MANAGERS
=
ADMINS
########## END MANAGER CONFIGURATION
########## END MANAGER CONFIGURATION
...
...
circle/dashboard/models.py
View file @
a30de002
...
@@ -86,7 +86,7 @@ class Profile(Model):
...
@@ -86,7 +86,7 @@ class Profile(Model):
use_gravatar
=
BooleanField
(
default
=
False
)
use_gravatar
=
BooleanField
(
default
=
False
)
email_notifications
=
BooleanField
(
email_notifications
=
BooleanField
(
verbose_name
=
_
(
"Email notifications"
),
default
=
True
,
verbose_name
=
_
(
"Email notifications"
),
default
=
True
,
help_text
=
_
(
'Wether user wants to get digested email notifications.'
))
help_text
=
_
(
'W
h
ether user wants to get digested email notifications.'
))
def
notify
(
self
,
subject
,
template
,
context
=
{},
valid_until
=
None
):
def
notify
(
self
,
subject
,
template
,
context
=
{},
valid_until
=
None
):
return
Notification
.
send
(
self
.
user
,
subject
,
template
,
context
,
return
Notification
.
send
(
self
.
user
,
subject
,
template
,
context
,
...
...
circle/dashboard/tasks/local_periodic_tasks.py
View file @
a30de002
...
@@ -51,7 +51,8 @@ def send_email_notifications():
...
@@ -51,7 +51,8 @@ def send_email_notifications():
'url'
:
(
settings
.
DJANGO_URL
.
rstrip
(
"/"
)
+
'url'
:
(
settings
.
DJANGO_URL
.
rstrip
(
"/"
)
+
reverse
(
"dashboard.views.notifications"
)),
reverse
(
"dashboard.views.notifications"
)),
'site'
:
settings
.
COMPANY_NAME
}
'site'
:
settings
.
COMPANY_NAME
}
subject
=
ungettext
(
"
%
d new notification"
,
subject
=
settings
.
EMAIL_SUBJECT_PREFIX
+
ungettext
(
"
%
d new notification"
,
"
%
d new notifications"
,
len
(
msgs
))
%
len
(
msgs
)
"
%
d new notifications"
,
len
(
msgs
))
%
len
(
msgs
)
body
=
render_to_string
(
'dashboard/notifications/email.txt'
,
body
=
render_to_string
(
'dashboard/notifications/email.txt'
,
context
)
context
)
...
...
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