def _get_token(self, token_str, app=None): kwargs = {'token': token_str} print "evaluating as SC, lookin gor", token_str try: ret = models.AccessToken.objects.get(**kwargs) if ret.smart_connect_p == False: oauth.report_error("Not a SMArt Connect Request -- don't treat as one!") return ret except models.AccessToken.DoesNotExist: oauth.report_error("No token means this isn't a SMArt Connect Request!")
def _get_token(self, token_str, app=None): kwargs = {'token': token_str} if app: kwargs['share__with_app'] = app try: ret = models.AccessToken.objects.get(**kwargs) if ret.smart_connect_p == True: oauth.report_error("Got a SMArt Connect Request -- should be a REST request") return ret except models.AccessToken.DoesNotExist: return None
def _get_token(self, token_str, app=None): kwargs = {'token': token_str} if app: kwargs['share__with_app'] = app try: ret = models.AccessToken.objects.get(**kwargs) if ret.smart_connect_p == True: oauth.report_error( "Got a SMArt Connect Request -- should be a REST request") return ret except models.AccessToken.DoesNotExist: return None
def _get_token(self, token_str, app=None): kwargs = {'token': token_str} print "evaluating as SC, lookin gor", token_str try: ret = models.AccessToken.objects.get(**kwargs) if ret.smart_connect_p == False: oauth.report_error( "Not a SMArt Connect Request -- don't treat as one!") return ret except models.AccessToken.DoesNotExist: oauth.report_error( "No token means this isn't a SMArt Connect Request!")