예제 #1
0
def storymap_migrate_list(user):
    """Get list of storymaps that still need to be migrated"""
    try:
        credentials = google.get_credentials(user['google']['credentials'])
        drive_service = google.get_drive_service(credentials)

        existing = [d['title'] for (k, d) in user['storymaps'].items()]

        temp_list = google.drive_get_migrate_list(drive_service)
        migrate_list = [r for r in temp_list if r['title'] not in existing]

        return jsonify({'migrate_list': migrate_list})
    except Exception, e:
        traceback.print_exc()
        return jsonify({'error': str(e)})
예제 #2
0
파일: api.py 프로젝트: jorol/StoryMapJS
def storymap_migrate_list(user):
    """Get list of storymaps that still need to be migrated"""
    try:
        credentials = google.get_credentials(user["google"]["credentials"])
        drive_service = google.get_drive_service(credentials)

        existing = [d["title"] for (k, d) in user["storymaps"].items()]

        temp_list = google.drive_get_migrate_list(drive_service)
        migrate_list = [r for r in temp_list if r["title"] not in existing]

        return jsonify({"migrate_list": migrate_list})
    except Exception, e:
        traceback.print_exc()
        return jsonify({"error": str(e)})