1 | 102,103c102
|
---|
2 | < #user_id = self.session[users.SESSION_KEY]
|
---|
3 | < user_id = self._req.user
|
---|
4 | ---
|
---|
5 | > user_id = self.session[users.SESSION_KEY]
|
---|
6 | 106,117c105,106
|
---|
7 | < try:
|
---|
8 | < self._user = users.get_object(username__exact=user_id)
|
---|
9 | < except (users.UserDoesNotExist):
|
---|
10 | < from django.models.auth import User
|
---|
11 | < import md5
|
---|
12 | < import datetime
|
---|
13 | < password_md5 = md5.new('fake').hexdigest()
|
---|
14 | < now = datetime.datetime.now()
|
---|
15 | < self._user = User(None, user_id,'','', user_id+'@cnet.com',password_md5,False,True,False,now,now)
|
---|
16 | < self._user.save()
|
---|
17 | < #except (AttributeError, KeyError, ValueError, users.UserDoesNotExist):
|
---|
18 | < except (AttributeError, KeyError, ValueError):
|
---|
19 | ---
|
---|
20 | > self._user = users.get_object(pk=user_id)
|
---|
21 | > except (AttributeError, KeyError, ValueError, users.UserDoesNotExist):
|
---|
22 | 120d108
|
---|
23 | <
|
---|