def delete(self, grantable): grants = grantable.my_grants() if len(grants) == 0: return logWith404(logger, 'ARDeleteHandler fatal error: no grant') area = grantable.area area.delete() return bcap.bcapNullResponse()
def delete(self, grantable): grants = grantable.my_grants() if len(grants) == 0: return logWith404(logger, 'UnverifiedUserDeleteHandler fatal error: no grant') uu = grantable.unverifieduser uu.delete() return bcap.bcapNullResponse()
def delete(self, grantable): grants = Grant.objects.filter(db_entity=grantable) if len(grants) == 0: return logWith404(logger, 'UnverifiedUserDeleteHandler fatal error: no grant') uu = grantable.unverifieduser uu.delete() return bcap.bcapNullResponse()
def delete(self, grantable): grants = Grant.objects.filter(db_entity=grantable) if len(grants) == 0: return logWith404(logger, 'ARDeleteHandler fatal error: no grant') area = grantable.area area.delete() return bcap.bcapNullResponse()
def glogin_landing(request): if request.method == 'GET': d = request.GET else: d = request.POST maybe_client_key = check_pending(request.path_info) if not maybe_client_key: return logWith404(logger, "Bad pending: %s" % request.path_info, level='error') # 11.4.2 Verifying directly with the OpenID Provider # 11.4.2.1. Request Parameters # . openid.mode # Value: "check_authentication" # . Exact copies of all fields from the authentication response, except # for "openid.mode". # http://openid.net/specs/openid-authentication-2_0.html#check_auth verify = {} for e in d: verify[e] = d[e] verify['openid.mode'] = 'check_authentication' try: f = urllib2.urlopen("https://www.google.com/accounts/o8/ud", urllib.urlencode(verify)) beginning = str(f.read()[0:13]) if(beginning != 'is_valid:true'): return bcap.bcapResponse('fail') except urllib2.HTTPError as e: logger.error("ErrorResponse: %s" % e.read()) return bcap.bcapNullResponse() identity = d['openid.identity'] email = d['openid.ext1.value.email'] q = GoogleCredentials.objects.filter(identity=identity) if len(q) == 0: station_cap = newStationCap() account = BelayAccount(station_url=station_cap.serialize()) account.save() gc = GoogleCredentials(account=account, identity=identity) gc.save() else: account = q[0].account session_id = str(uuid.uuid4()) session = BelaySession(account=account, session_id=session_id) session.save() response = render_to_response('glogin.html', { 'clientkey': maybe_client_key, 'station': account.station_url, 'make_stash': bcap.regrant('make-stash', account).serialize(), 'site_name': settings.SITE_NAME, 'email': email }) return response
def delete(self, grantable): grants = grantable.my_grants() if len(grants) == 0: return logWith404(logger, 'ScoreCategoryDeleteHandler fatal error: no grant') grantable.scorecategory.delete() return bcap.bcapNullResponse()
def delete(self, grantable): grants = Grant.objects.filter(db_entity=grantable) if len(grants) == 0: return logWith404(logger, 'ScoreCategoryDeleteHandler fatal error: no grant') grantable.scorecategory.delete() return bcap.bcapNullResponse()
def delete(self, granted): granted.stash.delete() return bcap.bcapNullResponse()
def put(self, granted, args): stash = granted.stash pd = bcap.dataPreProcess(args['private_data']) stash.stashed_content = pd stash.save() return bcap.bcapNullResponse()