thanks, uploading fix

On Aug 3, 7:09 am, molhokwai <molhok...@gmail.com> wrote:
> Hello,
>
> Just to share this modification in the
> gluon/contrib/login_methods/rpxaccount.py file that fixes an issue due to
> the fact that providers eventually send nothing for specific keys (ex:
> Facebook does not send the email key by default).
> The code (starting @line 56):
>
> ---------------------------------------------------------------------
>         self.mappings.Facebook = lambda profile:\
>             dict(registration_id = profile.get("identifier",""),
>                  username = profile.get("preferredUsername",""),
>                  email = profile.get("email",""),
>                  first_name = profile.get("name","").get("givenName",""),
>                  last_name = profile.get("name","").get("familyName",""))
>         self.mappings.Google = lambda profile:\
>             dict(registration_id=profile.get("identifier",""),
>                  username=profile.get("preferredUsername",""),
>                  email=profile.get("email",""),
>                  first_name=profile.get("name","").get("givenName",""),
>                  last_name=profile.get("name","").get("familyName",""))
>         self.mappings.default = lambda profile:\
>             dict(registration_id=profile.get("identifier",""),
>                  username=profile.get("preferredUsername",""),
>                  email=profile.get("email",""),
>                  first_name=profile.get("preferredUsername",""),
>                  last_name='')
> ---------------------------------------------------------------------
>
> Voilà.

Reply via email to