def get_latest_version(): response = get_json_file("version.json") if response.ok: return response.json()["version"] else: return ""
def get_current_version(): response = get_json_file("version.json") if response.ok: version_number = response.json()["version"] else: version_number = "" return version_number
def get_subjects_json(request): response = get_json_file("subjects.json") if response.ok: response_body = response.json() else: response_body = {} return JsonResponse(response_body, status=response.status_code, safe=False)
def get_options(): response = get_json_file("version.json") if response.ok: version = response.json()["version"] else: version = "" if version != InstitutionList.version: InstitutionList.options = load_institution_json() return InstitutionList.options
def load_institution_json(): institution_json = {} for language, language_full in enums.languages_map.items(): response = get_json_file("institutions_" + language + ".json") if response.ok: response_body = response.json() else: response_body = {} institution_json[language] = response_body return institution_json
def load_institution_json(): institution_json = {} for language, language_full in enums.languages_map.items(): response = get_json_file("institutions_" + language + ".json") data = response.json() de_duped = [] final = [ name for name in data if not_already_in_list(name=name["name"], existing=de_duped) ] if response.ok: response_body = final else: response_body = {} institution_json[language] = response_body return institution_json