messages.py 17.5 KB
Newer Older
1
# Copyright (C) 2010-2016 GRNET S.A.
Olga Brani's avatar
Olga Brani committed
2
#
Vangelis Koukis's avatar
Vangelis Koukis committed
3 4 5 6
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
Olga Brani's avatar
Olga Brani committed
7
#
Vangelis Koukis's avatar
Vangelis Koukis committed
8 9 10 11
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
Olga Brani's avatar
Olga Brani committed
12
#
Vangelis Koukis's avatar
Vangelis Koukis committed
13 14
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Olga Brani's avatar
Olga Brani committed
15

16
from django.conf import settings
17
import astakos.im.settings as astakos_settings
18
import synnefo_branding.settings as branding_settings
19 20


Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
21 22 23 24 25 26 27 28 29
LOGGED_IN_WARNING = 'It seems that you are already logged in.'
ACCOUNT_ALREADY_VERIFIED = 'This account is already verified.'
ACCOUNT_ALREADY_MODERATED = 'This account is already moderated.'
ACCOUNT_ALREADY_ACTIVE = 'This account is already active.'
ACCOUNT_REJECTED = 'This account has been rejected.'
ACCOUNT_NOT_ACTIVE = 'User account is not active.'
ACCOUNT_NOT_MODERATED = 'User account is not moderated.'
ACCOUNT_NOT_VERIFIED = 'User account does not have a verified email address.'
ACCOUNT_RESEND_ACTIVATION = (
30 31 32
    'It seems that a verification email has been sent to you, but you have '
    'not followed the email verification link. '
    '<a href="%(send_activation_url)s">Resend verification email.</a>')
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
33 34
INACTIVE_ACCOUNT_CHANGE_EMAIL = ''.join(
    [ACCOUNT_RESEND_ACTIVATION,
35
     ' Or <a href="%(signup_url)s">Send verification to a new email.</a>'])
36

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
37
ACCOUNT_PENDING_ACTIVATION_HELP = (
38 39 40
    'A verification email has been sent to the email address you specified '
    'during sign up. Please follow the link in this email to proceed. '
    'Make sure you check your spam folder, too.')
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
41

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
42 43 44 45 46 47 48 49 50 51
ACCOUNT_ACTIVATED = 'Congratulations. Your account has' + \
    ' been activated. You are now logged in.'
ACCOUNT_DEACTIVATED = 'Your account is inactive'
PASSWORD_RESET_DONE = (
    'An email with details on how to change your password has been sent. '
    'Please check your Inbox.')
PASSWORD_RESET_CONFIRM_DONE = (
    'Your password has changed successfully. You '
    'can now login using your new password.')
PASSWORD_CHANGED = 'Your new password was set successfully.'
52

53 54
ACCOUNT_RESEND_ACTIVATION = 'Resend verification email'
ACCOUNT_USER_ACTIVATION_PENDING = 'You have not followed the verification link'
55

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
56 57 58
ACCOUNT_UNKNOWN = 'There is no such account.'
TOKEN_UNKNOWN = 'There is no user matching this authentication token.'
TOKEN_UPDATED = 'Your authentication token has been updated successfully.'
Olga Brani's avatar
Olga Brani committed
59

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
60 61 62 63 64 65 66 67
PROFILE_UPDATED = 'Your profile has been updated successfully.'
FEEDBACK_SENT = (
    'Thank you for contacting us. We will process your message carefully '
    'and get back to you.')
EMAIL_CHANGED = 'The email of your account changed successfully.'
EMAIL_CHANGE_REGISTERED = (
    'Your request for changing your email has been registered successfully. '
    'A verification email will be sent to your new address.')
Olga Brani's avatar
Olga Brani committed
68

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
69 70 71 72
OBJECT_CREATED = 'The %(verbose_name)s was created successfully.'
USER_MEMBERSHIP_REJECTED = (
    'Request by %s to join the project has been rejected.')
BILLING_ERROR = 'Service response status: %(status)d'
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
73

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
74 75 76 77
GENERIC_ERROR = (
    'Hmm... It seems something bad has happened, and we don\'t know the '
    'details right now. Please contact the administrators by email for '
    'more details.')
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
78

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
MAX_INVITATION_NUMBER_REACHED = (
    'You have reached the maximum amount of invitations for your account. '
    'No invitations left.')
GROUP_MAX_PARTICIPANT_NUMBER_REACHED = (
    'This Group reached its maximum number of members. No other member can '
    'be added.')
PROJECT_MAX_PARTICIPANT_NUMBER_REACHED = (
    'This Project reached its maximum number of members. No other member '
    'can be added.')
NO_APPROVAL_TERMS = 'There are no terms of service to approve.'
PENDING_EMAIL_CHANGE_REQUEST = (
    'It seems there is already a pending request for an email change. '
    'Submitting a new request to change your email will cancel all previous '
    'requests.')
OBJECT_CREATED_FAILED = 'The %(verbose_name)s creation failed: %(reason)s.'
GROUP_JOIN_FAILURE = 'Failed to join this Group.'
PROJECT_JOIN_FAILURE = 'Failed to join this Project.'
GROUPKIND_UNKNOWN = 'The kind of Project you specified does not exist.'
NOT_MEMBER = 'User is not a member of the Project.'
NOT_OWNER = 'User is not the Project\'s owner.'
OWNER_CANNOT_LEAVE_GROUP = (
    'You are the owner of this Project. Owners can not leave their Projects.')
Olga Brani's avatar
Olga Brani committed
101 102

# Field validation fields
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
103 104 105 106 107 108 109 110 111
REQUIRED_FIELD = 'This field is required.'
EMAIL_USED = 'There is already an account with this email address.'
SHIBBOLETH_EMAIL_USED = (
    'This email is already associated with another shibboleth account.')
SHIBBOLETH_INACTIVE_ACC = (
    'This email is already associated with an account that is not '
    'yet activated. '
    'If that is your account, you need to activate it before being able to '
    'associate it with this shibboleth account.')
112
SHIBBOLETH_MISSING_USER_ID = (
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
113 114 115 116 117 118 119
    'Your request is missing a unique ' +
    'token. This means your academic ' +
    'institution does not yet allow its users to log ' +
    'into %(domain)s with their academic ' +
    'account. Please contact %(contact_email)s' +
    ' for more information.')
SHIBBOLETH_MISSING_NAME = 'This request is missing the user name.'
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
120

121
SIGN_TERMS = "Please, you need to 'Agree with the terms' before proceeding."
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
122 123 124
CAPTCHA_VALIDATION_ERR = (
    "You have not entered the correct words. Please try again."
)
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
125
SUSPENDED_LOCAL_ACC = (
126 127 128
    "This account does not have a local password. "
    "Please try logging in using an external login provider (e.g.: twitter)"
)
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
129
EMAIL_UNKNOWN = (
130 131 132 133 134 135
    "This email address doesn't have an associated user account. "
    "Please make sure you have registered, before proceeding."
)
INVITATION_EMAIL_EXISTS = "An invitation has already been sent to this email."
INVITATION_CONSUMED_ERR = "The invitation has already been used."
UNKNOWN_USERS = "Unknown users: %s"
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
136
UNIQUE_EMAIL_IS_ACTIVE_CONSTRAIN_ERR = (
137 138
    "More than one account with the same email & 'is_active' field. Error."
)
139
INVALID_ACTIVATION_KEY = "Invalid or already used activation key."
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
140
NEW_EMAIL_ADDR_RESERVED = (
141 142 143 144
    "The new email address you requested is already used by another account. "
    "Please provide a different one."
)
EMAIL_RESERVED = "Email: %(email)s is already reserved."
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
145
NO_LOCAL_AUTH = (
146 147 148 149
    "Only external login providers are enabled for this account. "
    "You can not login with a local password."
)
SWITCH_ACCOUNT_FAILURE = "Account failed to switch. Invalid parameters."
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
150
SWITCH_ACCOUNT_SUCCESS_WITH_PROVIDER = (
151 152 153 154 155
    "Account failed to switch to %(provider)s."
)
SWITCH_ACCOUNT_SUCCESS = (
    "Account successfully switched to %(provider)s."
)
Olga Brani's avatar
Olga Brani committed
156 157

# Field help text
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
158 159 160 161 162 163
ADD_GROUP_MEMBERS_Q_HELP = (
    'Add a comma separated list of user emails, eg. user1@user.com, '
    'user2@user.com')
ASTAKOSUSER_GROUPS_HELP = (
    'In addition to the permissions assigned manually, '
    'this user will also get all permissions coming from his/her groups.')
Olga Brani's avatar
Olga Brani committed
164

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
165 166 167 168 169 170 171 172 173 174
EMAIL_SEND_ERR = 'Failed to send %s.'
ADMIN_NOTIFICATION_SEND_ERR = EMAIL_SEND_ERR % 'admin notification'
VERIFICATION_SEND_ERR = EMAIL_SEND_ERR % 'verification'
INVITATION_SEND_ERR = EMAIL_SEND_ERR % 'invitation'
GREETING_SEND_ERR = EMAIL_SEND_ERR % 'greeting'
FEEDBACK_SEND_ERR = EMAIL_SEND_ERR % 'feedback'
CHANGE_EMAIL_SEND_ERR = EMAIL_SEND_ERR % 'email change'
NOTIFICATION_SEND_ERR = EMAIL_SEND_ERR % 'notification'
DETAILED_NOTIFICATION_SEND_ERR = (
    'Failed to send %(subject)s notification to %(recipients)s.')
Olga Brani's avatar
Olga Brani committed
175

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
176
MISSING_NEXT_PARAMETER = 'The next parameter is missing.'
Olga Brani's avatar
Olga Brani committed
177

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
178 179
INVITATION_SENT = 'Invitation sent to %(email)s.'
VERIFICATION_SENT = (
180 181 182
    'Your information has been submitted successfully. An email, containing a '
    'verification link has been sent to the email address you provided. '
    'Please follow the verification link on this email to continue with the '
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
183 184 185 186 187 188 189 190 191 192 193 194
    'registration process.')
VERIFICATION_FAILED = 'Email verification process failed.'
SWITCH_ACCOUNT_LINK_SENT = (
    'This email is already associated with a local account, '
    'and a verification email has been sent to %(email)s. To complete '
    'the association process, go back to your Inbox and follow the link '
    'inside the verification email.')
NOTIFICATION_SENT = (
    'Your request for an account has been submitted successfully, and is '
    'now pending approval. You will be notified by email in the next few '
    'days. Thanks for your interest!')
ACTIVATION_SENT = (
195
    'An email containing a verification link has been sent to your '
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
196
    'email address.')
197

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
198 199 200
REGISTRATION_COMPLETED = (
    'Your registration completed successfully. You can now login to your '
    'new account!')
201

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
202 203 204 205 206
NO_RESPONSE = 'There is no response.'
NOT_ALLOWED_NEXT_PARAM = 'Not allowed next parameter.'
MISSING_KEY_PARAMETER = 'Missing key parameter.'
INVALID_KEY_PARAMETER = 'Invalid key.'
DOMAIN_VALUE_ERR = 'Enter a valid domain.'
207
BASE_PROJECT_NAME_ERR = 'Enter a valid system project name.'
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
208 209 210 211
QH_SYNC_ERROR = 'Failed to get synchronized with quotaholder.'
UNIQUE_PROJECT_NAME_CONSTRAIN_ERR = (
    'The project name (as specified in its application\'s definition) must '
    'be unique among all active projects.')
212
NOT_ALIVE_PROJECT = 'Project %s is not alive.'
213
NOT_INITIALIZED_PROJECT = 'Project %s is not initialized.'
214
SUSPENDED_PROJECT = 'Project %s is suspended.'
215
NOT_SUSPENDED_PROJECT = 'Project %s is not suspended.'
216
NOT_TERMINATED_PROJECT = 'Project %s is not terminated.'
217
BASE_NO_TERMINATE = "Cannot terminate: %s is a system project."
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
218 219 220 221 222 223 224
NOT_ALLOWED = 'You do not have the permissions to perform this action.'
MEMBER_NUMBER_LIMIT_REACHED = (
    'You have reached the maximum number of members for this Project.')
MEMBER_JOIN_POLICY_CLOSED = 'The Project\'s member join policy is closed.'
MEMBER_LEAVE_POLICY_CLOSED = 'The project\'s member leave policy is closed.'
NOT_MEMBERSHIP_REQUEST = 'This is not a valid membership request.'
NOT_ACCEPTED_MEMBERSHIP = 'This is not an accepted membership.'
225
MEMBERSHIP_ACCEPTED = 'Membership already exists.'
226
MEMBERSHIP_ASSOCIATED = 'Request or membership already exists.'
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
NO_APPLICANT = (
    'Project application requires at least one applicant. None found.')
INVALID_PROJECT_START_DATE = (
    'Project start date should be equal or greater than the current date.')
INVALID_PROJECT_END_DATE = (
    'Project end date should be equal or greater than than the current date.')
INCONSISTENT_PROJECT_DATES = (
    'Project end date should be greater than the project start date.')
ADD_PROJECT_MEMBERS_Q_HELP = (
    'Add a comma separated list of user emails, eg. user1@user.com, '
    'user2@user.com')
ADD_PROJECT_MEMBERS_Q_PLACEHOLDER = 'user1@user.com, user2@user.com'
MISSING_IDENTIFIER = 'Missing identifier.'
UNKNOWN_USER_ID = 'There is no user identified by %s.'
UNKNOWN_PROJECT_APPLICATION_ID = (
    'There is no project application identified by %s.')
UNKNOWN_PROJECT_ID = 'There is no project identified by %s.'
UNKNOWN_IDENTIFIER = 'Unknown identifier.'
PENDING_MEMBERSHIP_LEAVE = (
    'Your request is pending moderation by the Project owner.')
USER_MEMBERSHIP_ACCEPTED = '%s has been accepted in the project.'
USER_MEMBERSHIP_REMOVED = '%s has been removed from the project.'
USER_LEFT_PROJECT = 'You have left the project.'
USER_LEAVE_REQUEST_SUBMITTED = (
    'Your request to leave the project has been submitted successfully.')
USER_JOIN_REQUEST_SUBMITTED = (
    'Your request to join the project has been submitted successfully.')
USER_JOINED_PROJECT = 'You have joined the project.'
USER_REQUEST_CANCELLED = 'Your request to join the project has been cancelled.'
APPLICATION_CANNOT_APPROVE = "Cannot approve application %s in state '%s'"
APPLICATION_CANNOT_DENY = "Cannot deny application %s in state '%s'"
APPLICATION_CANNOT_DISMISS = "Cannot dismiss application %s in state '%s'"
APPLICATION_CANNOT_CANCEL = "Cannot cancel application %s in state '%s'"
APPLICATION_CANCELLED = "Your project application has been cancelled."
261 262 263
APPLICATION_APPROVED = "Project application has been approved."
APPLICATION_DENIED = "Project application has been denied."
APPLICATION_DISMISSED = "Project application has been dismissed."
264 265
REACHED_PENDING_APPLICATION_LIMIT = ("You have reached the maximum number "
                                     "of pending project applications: %s.")
266
UNINITIALIZED_NO_MODIFY = "Cannot modify: project %s is not initialized."
267
BASE_NO_MODIFY_FIELDS = "Cannot modify field(s) '%s' of system projects."
268 269 270 271 272 273 274 275 276 277 278 279

PENDING_APPLICATION_LIMIT_ADD = \
    ("You are not allowed to create a new project "
     "because you have reached the maximum [%s] for "
     "pending project applications. "
     "Consider cancelling any unnecessary ones.")

PENDING_APPLICATION_LIMIT_MODIFY = \
    ("You are not allowed to modify this project "
     "because you have reached the maximum [%s] for "
     "pending project applications. "
     "Consider cancelling any unnecessary ones.")
280

281
# Auth providers messages
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
282
AUTH_PROVIDER_LOGIN_SUCCESS = "Logged in successfully, using {method_prompt}."
283
AUTH_PROVIDER_LOGOUT_SUCCESS = "Logged out successfully from {service_name}."
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
AUTH_PROVIDER_LOGOUT_SUCCESS_EXTRA = (
    "You may still be logged in at {title} though. "
    "Consider logging out from there too.")
AUTH_PROVIDER_NOT_ACTIVE = "'{method_prompt}' is disabled."
AUTH_PROVIDER_ADD_DISABLED = "{method_prompt} is disabled for your account."
AUTH_PROVIDER_NOT_ACTIVE_FOR_USER = "You cannot login using '{method_prompt}'."
AUTH_PROVIDER_NOT_ACTIVE_FOR_CREATE = (
    "Sign up using '{method_prompt}' is disabled.")
AUTH_PROVIDER_NOT_ACTIVE_FOR_ADD = "You cannot add {method_prompt}."
AUTH_PROVIDER_ADDED = "{method_prompt} enabled for this account."
AUTH_PROVIDER_SWITCHED = "{method_prompt} changed for this account."
AUTH_PROVIDER_REMOVED = "{method_prompt} removed for this account."
AUTH_PROVIDER_ADD_FAILED = "Failed to add {method_prompt}."
AUTH_PROVIDER_ADD_EXISTS = (
    "It seems that this '{method_prompt}' is already in use by "
    "another account.")
AUTH_PROVIDER_LOGIN_TO_ADD = (
    "The new login method will be assigned once you login to your account.")
AUTH_PROVIDER_INVALID_LOGIN = "No account exists."
AUTH_PROVIDER_REQUIRED = (
    "{method_prompt} is required. Add one from your profile page.")
AUTH_PROVIDER_CANNOT_CHANGE_PASSWORD = "Changing password is not supported."
AUTH_PROVIDER_SIGNUP_FROM_LOGIN = None
AUTH_PROVIDER_UNUSABLE_PASSWORD = (
    '{method_prompt} is not enabled'
    ' for your account. You can access your account by logging in with'
    ' {available_methods_links}.')
AUTH_PROVIDER_LOGIN_DISABLED = AUTH_PROVIDER_UNUSABLE_PASSWORD
AUTH_PROVIDER_SIGNUP_FROM_LOGIN = ''
AUTH_PROVIDER_AUTHENTICATION_FAILED = (
    'Authentication with this account failed.')
315 316


Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
317
AUTH_PROVIDER_PENDING_REGISTRATION = '''A pending registration exists for
318 319 320 321
{title} account {username}. The email used for the registration is
{user_email}. If you decide to procceed with the signup process once again,
all pending registrations will be deleted.'''

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
322
AUTH_PROVIDER_PENDING_RESEND_ACTIVATION = (
323
    '<a href="{resend_activation_url}">Click here to resend the verification '
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
324 325 326 327
    'email.</a>')
AUTH_PROVIDER_PENDING_MODERATION = (
    'Your account request is pending moderation.')
AUTH_PROVIDER_PENDING_ACTIVATION = (
328
    'Your account request is pending email verification.')
Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
329
AUTH_PROVIDER_ACCOUNT_INACTIVE = 'Your account is disabled.'
330

Giorgos Korfiatis's avatar
Giorgos Korfiatis committed
331 332 333
AUTH_PROVIDER_ADD_TO_EXISTING_ACCOUNT = (
    "You can add {method_prompt} to your existing account from your "
    " <a href='{profile_url}'>profile page</a>")
334

335
# Email subjects
336
_SITENAME = branding_settings.SERVICE_NAME
337
PLAIN_EMAIL_SUBJECT = 'New e-mail from %s' % _SITENAME
338 339 340
INVITATION_EMAIL_SUBJECT = 'Invitation to %s' % _SITENAME
GREETING_EMAIL_SUBJECT = 'Welcome to %s' % _SITENAME
FEEDBACK_EMAIL_SUBJECT = 'Feedback from %s' % _SITENAME
341
VERIFICATION_EMAIL_SUBJECT = '%s account verification' % _SITENAME
342 343 344
ACCOUNT_CREATION_SUBJECT = '%s account created (%%(user)s)' % _SITENAME
HELPDESK_NOTIFICATION_EMAIL_SUBJECT = \
    '%s account activated (%%(user)s)' % _SITENAME
345 346
EMAIL_CHANGE_NEW_EMAIL_SUBJECT = '%s e-mail change notification' % _SITENAME
EMAIL_CHANGE_OLD_EMAIL_SUBJECT = '%s e-mail change notification' % _SITENAME
347
EMAIL_ADMIN_APPLICATION_APPROVED = "%s project application approved ({0})" % _SITENAME
348
PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s' % _SITENAME
349
PROJECT_CREATION_SUBJECT = \
350 351 352
    '%s application for a new project created (%%s)' % _SITENAME
PROJECT_MODIFICATION_SUBJECT = \
    '%s application for a project modification created (%%s)' % _SITENAME
353
PROJECT_APPROVED_SUBJECT = \
354
    '%s project application approved (%%s)' % _SITENAME
355
PROJECT_DENIED_SUBJECT = \
356
    '%s project application denied (%%s)' % _SITENAME
357
PROJECT_TERMINATION_SUBJECT = \
358
    '%s project terminated (%%s)' % _SITENAME
359
PROJECT_SUSPENSION_SUBJECT = \
360
    '%s project suspended (%%s)' % _SITENAME
361
PROJECT_UNSUSPENSION_SUBJECT = \
362
    '%s project resumed (%%s)' % _SITENAME
363
PROJECT_REINSTATEMENT_SUBJECT = \
364
    '%s project reinstated (%%s)' % _SITENAME
365 366 367 368 369 370 371 372 373 374
PROJECT_MEMBERSHIP_CHANGE_SUBJECT = \
    '%s project membership changed (%%(name)s)' % _SITENAME
PROJECT_MEMBERSHIP_ENROLL_SUBJECT = \
    '%s project enrollment (%%(name)s)' % _SITENAME
PROJECT_MEMBERSHIP_REQUEST_SUBJECT = \
    '%s project membership request (%%(name)s)' % _SITENAME
PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT = \
    '%s project membership leave request (%%(name)s)' % _SITENAME


375 376 377 378 379 380
messages = locals().keys()
for msg in messages:
    if msg == msg.upper():
        attr = "ASTAKOS_%s_MESSAGE" % msg
        settings_value = getattr(settings, attr, None)
        if settings_value:
381
            locals()[msg] = settings_value