Revision 7d7f1f1b astakos/im/backends/__init__.py
b/astakos/im/backends/__init__.py | ||
---|---|---|
37 | 37 |
from django.core.mail import send_mail |
38 | 38 |
from django.template.loader import render_to_string |
39 | 39 |
from django.utils.translation import ugettext as _ |
40 |
from django.contrib.auth import authenticate, login |
|
40 | 41 |
from django.contrib.auth.forms import UserCreationForm |
41 | 42 |
from django.contrib.sites.models import Site |
42 | 43 |
from django.contrib import messages |
... | ... | |
45 | 46 |
from smtplib import SMTPException |
46 | 47 |
from urllib import quote |
47 | 48 |
|
48 |
from astakos.im.util import get_or_create_user |
|
49 | 49 |
from astakos.im.models import AstakosUser, Invitation |
50 | 50 |
from astakos.im.forms import ExtendedUserCreationForm, InvitedExtendedUserCreationForm |
51 | 51 |
|
... | ... | |
150 | 150 |
if self._is_preaccepted(user): |
151 | 151 |
user.is_active = True |
152 | 152 |
user.save() |
153 |
# get the raw password from the form |
|
154 |
password = form.cleaned_data['password1'] |
|
155 |
user = authenticate(username=user.email, password=password) |
|
156 |
login(self.request, user) |
|
153 | 157 |
message = _('Registration completed. You can now login.') |
154 | 158 |
else: |
155 | 159 |
message = _('Registration completed. You will receive an email upon your account\'s activation') |
Also available in: Unified diff