Mercurial > wikked
annotate wikked/auth.py @ 7:256e563c49b7
Better looking title decorators.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 19 Dec 2012 20:29:54 -0800 |
parents | c946f4facfa2 |
children | 30ae685b86df |
rev | line source |
---|---|
0 | 1 from wikked import login_manager |
2 | |
3 class User(object): | |
4 | |
5 username = '' | |
6 password = '' | |
7 email = '' | |
8 | |
9 def is_authenticated(self): | |
10 return True | |
11 | |
12 def is_active(self): | |
13 return True | |
14 | |
15 def is_anonymous(self): | |
16 return False | |
17 | |
18 def get_id(self): | |
19 return str(self.username) | |
20 | |
21 | |
22 @login_manager.user_loader | |
23 def load_user(userid): | |
24 try: | |
25 return User.objects.get(username=userid) | |
26 except: | |
27 return None |