Revision 890b0eaf astakos/im/target/invitation.py
b/astakos/im/target/invitation.py | ||
---|---|---|
37 | 37 |
|
38 | 38 |
from django.conf import settings |
39 | 39 |
from django.http import HttpResponseBadRequest |
40 |
from django.contrib.auth import authenticate |
|
40 | 41 |
|
41 | 42 |
from astakos.im.models import Invitation |
42 | 43 |
from astakos.im.target.util import prepare_response |
... | ... | |
56 | 57 |
logging.info('Accepted invitation %s', invitation) |
57 | 58 |
|
58 | 59 |
user = get_or_create_user(invitation.uniq, |
59 |
invitation.realname,
|
|
60 |
'Invitation',
|
|
61 |
invitation.inviter.level + 1)
|
|
60 |
invitation.realname, |
|
61 |
'Invitation', |
|
62 |
invitation.inviter.level + 1) |
|
62 | 63 |
|
64 |
# in order to login the user we must call authenticate first |
|
65 |
authenticate(username=user.username, auth_token=user.auth_token) |
|
63 | 66 |
next = request.GET.get('next') |
64 | 67 |
|
65 | 68 |
return prepare_response(request, user, next, 'renew' in request.GET) |
Also available in: Unified diff