Revision 0a7a4104 snf-astakos-app/astakos/im/functions.py
b/snf-astakos-app/astakos/im/functions.py | ||
---|---|---|
42 | 42 |
from django.contrib.auth import ( |
43 | 43 |
login as auth_login, |
44 | 44 |
logout as auth_logout) |
45 |
from django.conf import settings |
|
46 | 45 |
from django.contrib.auth.models import AnonymousUser |
47 | 46 |
from django.core.exceptions import PermissionDenied |
48 | 47 |
from django.db import IntegrityError |
... | ... | |
54 | 53 |
from datetime import datetime |
55 | 54 |
from functools import wraps |
56 | 55 |
|
57 |
import astakos.im.settings as astakos_settings |
|
58 | 56 |
from astakos.im.settings import ( |
59 | 57 |
CONTACT_EMAIL, SITENAME, BASEURL, LOGGING_LEVEL, |
60 | 58 |
VERIFICATION_EMAIL_SUBJECT, ACCOUNT_CREATION_SUBJECT, |
... | ... | |
64 | 62 |
PROJECT_CREATION_SUBJECT, PROJECT_APPROVED_SUBJECT, |
65 | 63 |
PROJECT_TERMINATION_SUBJECT, PROJECT_SUSPENSION_SUBJECT, |
66 | 64 |
PROJECT_MEMBERSHIP_CHANGE_SUBJECT, |
67 |
PROJECT_MEMBER_JOIN_POLICIES, PROJECT_MEMBER_LEAVE_POLICIES, HELPDESK, |
|
68 |
ADMINS, MANAGERS) |
|
65 |
PROJECT_MEMBER_JOIN_POLICIES, PROJECT_MEMBER_LEAVE_POLICIES) |
|
69 | 66 |
from astakos.im.notifications import build_notification, NotificationError |
70 | 67 |
from astakos.im.models import ( |
71 | 68 |
AstakosUser, Invitation, ProjectMembership, ProjectApplication, Project, |
... | ... | |
79 | 76 |
application_submit_notify, application_approve_notify, |
80 | 77 |
application_deny_notify, |
81 | 78 |
project_termination_notify, project_suspension_notify) |
82 |
|
|
79 |
from astakos.im import settings |
|
83 | 80 |
import astakos.im.messages as astakos_messages |
84 | 81 |
from astakos.quotaholder.exception import NoCapacityError |
85 | 82 |
|
... | ... | |
147 | 144 |
dictionary = dictionary or {} |
148 | 145 |
message = render_to_string(template_name, dictionary) |
149 | 146 |
sender = settings.SERVER_EMAIL |
150 |
recipient_list = [e[1] for e in HELPDESK + MANAGERS]
|
|
147 |
recipient_list = [e[1] for e in settings.HELPDESK + settings.MANAGERS]
|
|
151 | 148 |
try: |
152 | 149 |
send_mail(subject, message, sender, recipient_list, |
153 | 150 |
connection=get_connection()) |
... | ... | |
177 | 174 |
{'user': user} |
178 | 175 |
) |
179 | 176 |
sender = settings.SERVER_EMAIL |
180 |
recipient_list = [e[1] for e in HELPDESK + MANAGERS]
|
|
177 |
recipient_list = [e[1] for e in settings.HELPDESK + settings.MANAGERS]
|
|
181 | 178 |
try: |
182 | 179 |
send_mail(_(HELPDESK_NOTIFICATION_EMAIL_SUBJECT) % {'user': user.email}, |
183 | 180 |
message, sender, recipient_list, connection=get_connection()) |
... | ... | |
246 | 243 |
def send_feedback(msg, data, user, email_template_name='im/feedback_mail.txt'): |
247 | 244 |
subject = _(FEEDBACK_EMAIL_SUBJECT) |
248 | 245 |
from_email = settings.SERVER_EMAIL |
249 |
recipient_list = [e[1] for e in HELPDESK] |
|
246 |
recipient_list = [e[1] for e in settings.HELPDESK]
|
|
250 | 247 |
content = render_to_string(email_template_name, { |
251 | 248 |
'message': msg, |
252 | 249 |
'data': data, |
... | ... | |
894 | 891 |
user=user_id, setting=key) |
895 | 892 |
return setting.value |
896 | 893 |
except UserSetting.DoesNotExist: |
897 |
return getattr(astakos_settings, key)
|
|
894 |
return getattr(settings, key) |
|
898 | 895 |
|
899 | 896 |
|
900 | 897 |
def set_user_setting(user_id, key, value): |
Also available in: Unified diff