示例#1
0
 def createUserLogin (self, externalUser) :
     #Get user
     try : 
         user = User.objects.get(email_address = externalUser['email']);
     #Create user
     except : 
         user = self.createUser(externalUser);
     #UserLoginModel
     userLogin = UserLogin(user = user, access_token = self.accessToken);
     userLogin.provider = 'facebook';
     userLogin.provider_id = externalUser['id'];
     userLogin.save();
     return userLogin;
示例#2
0
 def createUserLogin (self, externalUser) :
     #Get user
     try : 
         user = User.objects.get(email_address = externalUser['emails'][0]['value']);
     #Create user
     except :
         user = self.createUser(externalUser);
     #Create user login
     userLogin = UserLogin(user = user, access_token = self.accessToken);
     userLogin.provider = 'google';
     userLogin.provider_id = externalUser['id'];
     userLogin.save();
     return userLogin;
示例#3
0
 def createUserLogin(self, externalUser):
     #Get user
     try:
         user = User.objects.get(email_address=externalUser['email'])
     #Create user
     except:
         user = self.createUser(externalUser)
     #UserLoginModel
     userLogin = UserLogin(user=user, access_token=self.accessToken)
     userLogin.provider = 'facebook'
     userLogin.provider_id = externalUser['id']
     userLogin.save()
     return userLogin
示例#4
0
 def createUserLogin(self, externalUser):
     #Get user
     try:
         user = User.objects.get(
             email_address=externalUser['emails'][0]['value'])
     #Create user
     except:
         user = self.createUser(externalUser)
     #Create user login
     userLogin = UserLogin(user=user, access_token=self.accessToken)
     userLogin.provider = 'google'
     userLogin.provider_id = externalUser['id']
     userLogin.save()
     return userLogin