Ejemplo n.º 1
0
def get_all_orgs():
    serialized = []
    try:
        orgs = Organization.query.all()
        serialized = [Organization.serialize(item) for item in orgs]
    except:
        db.session.rollback()
    return jsonify(message=serialized), 200
Ejemplo n.º 2
0
def get_organizations(sel):
    serialized = []

    if sel == 'true':
        #get all organizations you are an admin of
        orgs = current_identity.organizations_as_admin
    else:
        #get all organizations you are a member of
        orgs = current_identity.organizations_as_member

    serialized = [Organization.serialize(item) for item in orgs]
    return jsonify(message=serialized), 200