Skip to content

Commit 13c3f2f

Browse files
purpLee Li
authored andcommitted
update readme
Signed-off-by: Lee Li <[email protected]>
1 parent 68eac26 commit 13c3f2f

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

README

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,9 @@
22

33
PyFacebook is a Python client library for the Facebook API.
44

5-
Samuel Cormier-Iijima ([email protected])
6-
Niran Babalola ([email protected])
7-
Shannon -jj Behrens ([email protected])
8-
David B. Edelstein ([email protected])
9-
Max Battcher ([email protected])
10-
Rohan Deshpande ([email protected])
11-
Matthew Stevens ([email protected])
12-
Sandro Turriate ([email protected])
13-
Benjamin Zimmerman ([email protected])
14-
Gisle Aas ([email protected])
15-
Rand Bradley ([email protected])
16-
Luke Worth ([email protected])
17-
Andreas Cederström ([email protected])
18-
Samuel Hoffstaetter ([email protected])
19-
20-
http://github.com/sciyoshi/pyfacebook/
5+
6+
7+
http://github.com/shuge/pyfacebook/
218

229
== Usage ==
2310

@@ -37,7 +24,7 @@ See the developer wiki for more information.
3724

3825
== License ==
3926

40-
Copyright (c) 2008, Samuel Cormier-Iijima
27+
Copyright (c) 2010, Lee Li
4128
All rights reserved.
4229

4330
Redistribution and use in source and binary forms, with or without

facebook/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,8 @@ def check_session(self, request):
12941294

12951295
# fixed by Shuge Lee
12961296
# http://github.com/sciyoshi/pyfacebook/issues#issue/34
1297-
expires = param.get('expires', 0)
1298-
if expires == None:
1297+
expires = params.get('expires', 0)
1298+
if expires == 'None':
12991299
expires = 0
13001300
else:
13011301
expires = int(expires)

facebook/djangofb/default_app/models.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@
44
# from outside of a view, which lets us have cleaner code
55
from facebook.djangofb import get_facebook_client
66

7+
8+
def _2int(d, k):
9+
try:
10+
d = d.__dict__
11+
except:
12+
pass
13+
14+
t = d.get(k, '')
15+
if t == 'None':
16+
t = 0
17+
else:
18+
t = int(t)
19+
return t
20+
721
class UserManager(models.Manager):
822
"""Custom manager for a Facebook User."""
923

1024
def get_current(self):
1125
"""Gets a User object for the logged-in Facebook user."""
1226
facebook = get_facebook_client()
13-
user, created = self.get_or_create(id=int(facebook.uid))
27+
user, created = self.get_or_create(id=_2int(facebook, 'uid'))
1428
if created:
1529
# we could do some custom actions for new users here...
1630
pass

0 commit comments

Comments
 (0)