Revision 68a77896 invitations/invitations.py

b/invitations/invitations.py
42 42
from django.template.loader import render_to_string
43 43
from django.core.validators import validate_email
44 44
from django.views.decorators.csrf import csrf_protect
45
from django.utils.translation import gettext_lazy as _
45
from django.utils.translation import ugettext as _
46 46

  
47 47
from synnefo.logic.email_send import send_async
48 48
from synnefo.api.common import method_not_allowed
......
94 94

  
95 95

  
96 96
def validate_name(name):
97
    if name is None or name.strip() == '' :
97
    if name is None or name.strip() == '':
98 98
        raise ValidationError("Name is empty")
99 99

  
100 100
    if name.find(' ') is -1:
......
147 147

  
148 148
    PADDING = '{'
149 149

  
150
    try :
150
    try:
151 151
        DecodeAES = lambda c, e: c.decrypt(base64.b64decode(e)).rstrip(PADDING)
152 152
        cipher = AES.new(settings.INVITATION_ENCR_KEY)
153 153
        decoded = DecodeAES(cipher, key)
......
233 233
    send_async(
234 234
        frm = "%s <%s>"%(invitation.source.realname,invitation.source.uniq),
235 235
        to = "%s <%s>"%(invitation.target.realname,invitation.target.uniq),
236
        subject = u'Πρόσκληση στην υπηρεσία Ωκεανός',
237
        #subject = _('Invitation to IaaS service Okeanos'),
236
        subject = _('Invitation to IaaS service Okeanos'),
238 237
        body = data
239 238
    )
240 239

  
241

  
242 240
def get_invitee_level(source):
243 241
    return get_user_inv_level(source) + 1
244 242

  

Also available in: Unified diff