Revision f9aea9c8

b/snf-astakos-app/astakos/im/activation_backends.py
107 107
    def handle_activation(
108 108
        self, user, activation_template_name='im/activation_email.txt',
109 109
        greeting_template_name='im/welcome_email.txt',
110
        admin_email_template_name='im/admin_notification.txt'
110
        admin_email_template_name='im/account_creation_notification.txt',
111
        helpdesk_email_template_name='im/helpdesk_notification.txt'
111 112
    ):
112 113
        """
113 114
        If the user is already active returns immediately.
......
123 124

  
124 125
            if self._is_preaccepted(user):
125 126
                if user.email_verified:
126
                    activate(user, greeting_template_name)
127
                    activate(
128
                        user,
129
                        greeting_template_name,
130
                        helpdesk_email_template_name
131
                    )
127 132
                    return RegistationCompleted()
128 133
                else:
129
                    send_activation(user, activation_template_name)
134
                    send_activation(
135
                        user,
136
                        activation_template_name
137
                    )
130 138
                    return VerificationSent()
131 139
            else:
132 140
                send_account_creation_notification(
b/snf-astakos-app/astakos/im/functions.py
163 163
    return _send_admin_notification(template_name, dictionary, subject=subject)
164 164

  
165 165

  
166
def send_helpdesk_notification(user, template_name='im/account_notification.txt'):
166
def send_helpdesk_notification(user, template_name='im/helpdesk_notification.txt'):
167 167
    """
168 168
    Send email to DEFAULT_CONTACT_EMAIL to notify for a new user activation.
169 169

  
......
275 275
        logger.log(LOGGING_LEVEL, msg)
276 276

  
277 277

  
278
def activate(user, email_template_name='im/welcome_email.txt',
279
             helpdesk_email_template_name='im/helpdesk_notification.txt', verify_email=False):
278
def activate(
279
    user,
280
    email_template_name='im/welcome_email.txt',
281
    helpdesk_email_template_name='im/helpdesk_notification.txt',
282
    verify_email=False
283
):
280 284
    """
281 285
    Activates the specific user and sends email.
282 286

  
b/snf-astakos-app/astakos/im/models.py
1061 1061
    set_default_group(instance)
1062 1062
    # TODO handle socket.error & IOError
1063 1063
    register_users((instance,))
1064
    instance.renew_token()
1065 1064

  
1066 1065

  
1067 1066
def resource_post_save(sender, instance, created, **kwargs):
......
1096 1095
    send_quota(users)
1097 1096

  
1098 1097
def renew_token(sender, instance, **kwargs):
1099
    if not instance.id:
1098
    if not instance.auth_token:
1100 1099
        instance.renew_token()
1101 1100

  
1102 1101
post_syncdb.connect(fix_superusers)
b/snf-astakos-app/astakos/im/tasks.py
37 37
from functools import wraps
38 38

  
39 39
from astakos.im.endpoints.qh import send_quota
40
from astakos.im.endpoints.aquarium.producer import (report_credits_event,
41
                                                    report_user_event
42
                                                    )
40
from astakos.im.endpoints.aquarium.producer import (
41
    report_credits_event,
42
    report_user_event
43
)
43 44
from astakos.im.endpoints.aquarium.client import AquariumClient
44 45

  
45 46
import logging
b/snf-astakos-app/astakos/im/templates/im/account_creation_notification.txt
1
--- A translation in English follows ---
2

  
3
Έχει δημιουργηθεί ο παρακάτω λογαριασμός:
4

  
5
Email:          {{user.email}}
6
First name:     {{user.first_name}}
7
Last name:      {{user.last_name}}
8
Is active:      {{user.is_active}}
9
Level:          {{user.level}}
10
Invitations:    {{user.invitations}}
11

  
12
Για την ενεργοποίησή του μπορείτε να χρησιμοποιήσετε το command line εργαλείο snf-manage sendactivation
13
--
14

  
15
The following account has been created:
16

  
17
Email:          {{user.email}}
18
First name:     {{user.first_name}}
19
Last name:      {{user.last_name}}
20
Is active:      {{user.is_active}}
21
Level:          {{user.level}}
22
Invitations:    {{user.invitations}}
23

  
24
For its activation you can use the command line tool snf-manage sendactivation
/dev/null
1
--- A translation in English follows ---
2

  
3
{% if group_creation %}
4
Έχει δημιουργηθεί ο παρακάτω λογαριασμός:
5
{% else %}
6
Έχει ενεργοποιηθεί ο παρακάτω λογαριασμός:
7
{% endif %}
8

  
9
Email:          {{user.email}}
10
First name:     {{user.first_name}}
11
Last name:      {{user.last_name}}
12
Is active:      {{user.is_active}}
13
Level:          {{user.level}}
14
Invitations:    {{user.invitations}}
15

  
16
{% if group_creation %}
17
Για την ενεργοποίησή του μπορείτε να χρησιμοποιήσετε το command line εργαλείο snf-manage user_send_activation
18
{% endif %}
19
--
20

  
21
{% if group_creation %}
22
The following account has been created:
23
{% else %}
24
The following account has been activated:
25
{% endif %}
26

  
27
Email:          {{user.email}}
28
First name:     {{user.first_name}}
29
Last name:      {{user.last_name}}
30
Is active:      {{user.is_active}}
31
Level:          {{user.level}}
32
Invitations:    {{user.invitations}}
33

  
34
{% if group_creation %}
35
For its activation you can use the command line tool snf-manage user_send_activation
36
{% endif %}
/dev/null
1
--- A translation in English follows ---
2

  
3
Έχει δημιουργηθεί ο παρακάτω λογαριασμός:
4

  
5
Email:          {{user.email}}
6
First name:     {{user.first_name}}
7
Last name:      {{user.last_name}}
8
Is active:      {{user.is_active}}
9
Level:          {{user.level}}
10
Invitations:    {{user.invitations}}
11

  
12
Για την ενεργοποίησή του μπορείτε να χρησιμοποιήσετε το command line εργαλείο snf-manage sendactivation
13
--
14

  
15
The following account has been created:
16

  
17
Email:          {{user.email}}
18
First name:     {{user.first_name}}
19
Last name:      {{user.last_name}}
20
Is active:      {{user.is_active}}
21
Level:          {{user.level}}
22
Invitations:    {{user.invitations}}
23

  
24
For its activation you can use the command line tool snf-manage sendactivation
b/snf-astakos-app/astakos/im/views.py
1159 1159
    
1160 1160
    # validate sorting
1161 1161
    sorting = 'groupname'
1162
    print '>>>', sorting, request.GET
1163 1162
    sort_form = AstakosGroupSortForm(request.GET)
1164 1163
    if sort_form.is_valid():
1165 1164
        sorting = sort_form.cleaned_data.get('sorting')
1166
    print '<<<', sorting
1167 1165
    q = q.order_by(sorting)
1168 1166
    
1169 1167
    return object_list(

Also available in: Unified diff