From 19f4c7b95bf32d0cf581274d947bdc9120c2e8f2 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Fri, 8 Jul 2016 10:45:38 +0530 Subject: oauth implemented User can login via google and facebook. If user logs in from google and then later the same user logs in from facebook, then he will be considered as the same user if the email registered on facebook is of gmail. User profile will be created when user logs in via facebook or google. In yaksh pipeline, user.py is used to create profile. Pipeline settings is defined that defines the functions to be executed during oauth. Used bootstrap social and Font Awesome for UI design --- yaksh/pipeline/user.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 yaksh/pipeline/user.py (limited to 'yaksh/pipeline/user.py') diff --git a/yaksh/pipeline/user.py b/yaksh/pipeline/user.py new file mode 100644 index 0000000..4aecd95 --- /dev/null +++ b/yaksh/pipeline/user.py @@ -0,0 +1,8 @@ +from yaksh.models import Profile +#from django.contrib.auth.models import User + +def save_profile(backend, user, response, *args, **kwargs): + if not hasattr(user, 'profile'): + profile = Profile.objects.create(user=user) + profile.roll_number = profile.id + profile.save() -- cgit