Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Look Behind the Curtain

Look Behind the Curtain

A Python Zagreb meetup talk about why we should not be afraid of poking into someone else's code.

Senko Rašić

November 14, 2017
Tweet

More Decks by Senko Rašić

Other Decks in Programming

Transcript

  1. “When the getDVRConversions is set to True it expires conversions

    automatically.” —paid support Proprietary software
  2. class OAuth2CallbackView(OAuth2View): def dispatch(self, request): … login = self.adapter.complete_login(…) …

    return complete_social_login(request, login) ↓ # allauth.socialaccount.helpers def _complete_social_login(req, sociallogin): … if sociallogin.is_existing: … else: ret = _process_signup(req, sociallogin) ↓ # allauth.socialaccount.models class SocialLogin(object): @property def is_existing(self): return self.account.pk
  3. # a.sa.provider.google.views class GoogleOAuth2Adapter(OAuth2Adapter): def complete_login(…): … login = self.get_provider().

    \ sociallogin_from_response(…) ↓ # a.sa.providers.base class Provider(object): def sociallogin_from_response(…): … sociallogin.user = adapter.new_user(req, sociallogin) … ↓