def join_org(org_id): if request.method == 'POST' and is_request_json(): request.data # Reading the data will avoid uwsgi bug. Thanks to Jasdeep(Sunny) Bhumber. result = controllers.putPersonInOrganization(org_id, db, current_user.get_id()) return Response(response=result, mimetype='application/json') else: return jsonify(msg='Other request method[%s]' % request.method)
def browse_orgs(): data = controllers.getAllOrgNamesJSON(db) memberData = controllers.getMemberDataJSON(db, current_user.get_id()) if request.method == 'GET' and is_request_json(): return Response(response=data, status=200, mimetype='application/json') else: return render_template('browse_orgs.html', data=json.loads(data), memberData=json.loads(memberData))