def get(self): profile = Profile.get_or_create() assert profile is not None agencies = Agency.query(Agency.enabled == True) if agencies.count(limit=1) < 1: agencies = None context = dict( object_list=agencies, report_count=StopReport.query(StopReport.user == profile.key).count(limit=100), ) self.render_to_response('agency_list.html', context)