Revision e7cb4085 snf-astakos-app/astakos/im/management/commands/user-activation-send.py

b/snf-astakos-app/astakos/im/management/commands/user-activation-send.py
33 33

  
34 34
from django.core.management.base import BaseCommand, CommandError
35 35

  
36
from astakos.im.functions import send_activation, SendMailError
36
from astakos.im import activation_backends
37
activation_backend = activation_backends.get_backend()
37 38

  
38 39
from ._common import get_user
39 40

  
......
51 52
            if not user:
52 53
                self.stderr.write("Unknown user '%s'\n" % (email_or_id,))
53 54
                continue
54
            if user.email_verified and user.is_active:
55
            if user.email_verified:
55 56
                self.stderr.write(
56
                    "Already active user '%s'\n" % (email_or_id,))
57
                    "User email already verified '%s'\n" % (user.email,))
57 58
                continue
58 59

  
59 60
            try:
60
                send_activation(user)
61
                activation_backend.send_user_verification_email(user)
61 62
            except SendMailError, e:
62 63
                raise CommandError(e.message)
63 64

  

Also available in: Unified diff