def get(self): if not signed_request(request.args, request.form) or not registered(): abort(403) # determine how well the load is balanced. # are there any unassigned feeds? unassigned = [ x for x in feeds.find({'cat':'unassigned'}) ] app.logger.debug('%s' % unassigned) if not unassigned: return '' abort(401)
def add_feed_to_master_list(feed): candidates = [ x for x in feeds.find({'xml_url':feed['xml_url']})] if len(candidates) == 0: #add a new thing feed['subscribers'] = 1 feed['new'] = True gfid = feeds.insert(feed) elif len(candidates) == 1: gfid = candidates[0]['id'] #increment else: abort(406) #need a better code here return gfid