Skip to content

Rework in Admin / Auth / Points/Achievements #10

Merged
merged 22 commits into from Feb 23, 2012

2 participants

@schmidsi

Admin:
Because we have now the structured organisation, its no longer required to have the admin configuration in the root and the FACEBOOK_ADMIN in settings.py because the facebook modules are activated granular. So the admin.py is removed and all code moved to the corresponding modules.

Auth:
Always update the user who is now authenticated. This caused some errors on pages, who get the friends of the users: if a facebook user was already created django side, because of a friendslookup, he wasn't updated if he startet to use the page himself. so there were no email or additional infos in the db although he gave the permissions.
Secondly: Some fixes, but I think, the whole auth backend needs a rework. Lets get inspired by other django-facebook libs

Points/Achievements:
Simply make them work with the structured approach. Mainly import errors.

General Slug discussion:
Slug creation should go like this:
1. if facebook provides a unique username, use this
2. if not, try to build something nice with first_name, last_name (depending on the object) and the unique id. f.e. { first_name }-{ last_name }-{ id }
3. defaulting to id

schmidsi added some commits Nov 1, 2011
@schmidsi schmidsi import GraphAPIError from right module 9200cbb
@schmidsi schmidsi late import 93af0d2
@schmidsi schmidsi display user name in deauth callback debug mode log 69402aa
@schmidsi schmidsi Merge branch 'structured' of git://github.com/feinheit/django-faceboo…
…k-graph into structured

Conflicts:
	facebook/oauth2.py
8e91c9e
@schmidsi schmidsi fix bug: the graph response is a dict, not an object. d302c53
@schmidsi schmidsi import django settings b63a1ba
@schmidsi schmidsi display post link. can be discussed, but its a really important field 07a0b74
@schmidsi schmidsi resolve conflict 1516e62
@schmidsi schmidsi small improvements in login workflow:
really check for netloc (untested)
ignore ajax (ajax calls should give appropriate next params)
fix: redirect also if user has to be loggedin
23f6b23
@schmidsi schmidsi make nice slugs and use slugs as django username 92be136
@schmidsi schmidsi kill super admin, make admin per module 75e7909
@schmidsi schmidsi rework achievements & scores; so far untested c38eff2
@schmidsi schmidsi also points are optional by default a9d7f5a
@schmidsi schmidsi get app dict from new location 0df37e6
@schmidsi schmidsi small auth rework: save the accesstoken to db and keep it up to date f7b8869
@schmidsi schmidsi get_friends can be called without graph, if the user has an access_to…
…ken asociated
b6a072b
@schmidsi schmidsi not sure, but this should fix a bug 1a43cb8
@schmidsi schmidsi fix accidenteliy broken auth backend 67059fd
@schmidsi schmidsi always update the facebook user who is authenticated: he could exist …
…in the db as a friend of another user
d772727
@schmidsi schmidsi try to fix auth, show email in list bb7d99a
@schmidsi schmidsi blub ce4a996
@schmidsi schmidsi make _username as readonly field 0e6a1de
@sbaechler

Hier müssen wir noch einen getter definieren, welcher das Access Token nur zurück gibt, wenn es noch gültig ist. (Anhand des Timestamps).

Grundsätzlich ja, das müssen wir sogar global überprüfen mit Hilfsfunktionen, ich frage mich: unter welchen Umständen kann das Access Token bei Aufruf dieser Funktion abgelaufen sein?

@sbaechler

Dies möchte ich verhindern. Es ist Sache der View, für ein gultiges Access Token zu sorgen. Ansonsten müssen wir den ganzen Code absichern, dass das Token in der Datenbank immer up do date ist. Manchmal kommt das Token auch aus der Session und wird von dort in die Django-Session geschrieben.

@sbaechler sbaechler merged commit da2440f into feinheit:structured Feb 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.