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;
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;
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
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