def ssl_login_shortcut(func):
 def wrapped(*args, **kwargs):
  '\n        This manages the function wrapping, by determining whether to inject\n        the _external signup or just continuing to the internal function\n        call.\n        '
  if (not settings.FEATURES['AUTH_USE_CERTIFICATES']):
   return func(*args, **kwargs)
  request = args[0]
  if (request.user and request.user.is_authenticated()):
   return func(*args, **kwargs)
  cert = ssl_get_cert_from_request(request)
  if (not cert):
   return func(*args, **kwargs)
  def retfun():
   'Wrap function again for call by _external_login_or_signup'
   return func(*args, **kwargs)
  (_user, email, fullname) = _ssl_dn_extract_info(cert)
  return _external_login_or_signup(request, external_id=email, external_domain='ssl:MIT', credentials=cert, email=email, fullname=fullname, retfun=retfun)
 return wrapped

def ssl_login_shortcut ( func ) : def wrapped ( * args , ** kwargs ) : if ( not settings . FEATURES [ 'AUTH_USE_CERTIFICATES' ] ) : return func ( * args , ** kwargs ) request = args [ 0 ] if ( request . user and request . user . is_authenticated ( ) ) : return func ( * args , ** kwargs ) cert = ssl_get_cert_from_request ( request ) if ( not cert ) : return func ( * args , ** kwargs ) def retfun ( ) : return func ( * args , ** kwargs ) ( _user , email , fullname ) = _ssl_dn_extract_info ( cert ) return _external_login_or_signup ( request , external_id = email , external_domain = 'ssl:MIT' , credentials = cert , email = email , fullname = fullname , retfun = retfun ) return wrapped
python function decorator for login procedures .