disable adding new languages

This commit is contained in:
weeman 2021-11-22 21:31:17 +01:00
parent 9baf08d6b6
commit a3919d5d51
Signed by untrusted user: weeman
GPG Key ID: 34F0524D4DA694A1

View File

@ -30,16 +30,10 @@ def update_languages(profile, languages_data):
profile_language_ids = []
for language_data in languages_data:
if "id" in language_data["language"]:
if "id" not in language_data["language"]:
continue
language = Language.query.get(language_data["language"]["id"])
else:
language_name = language_data["language"]["name"]
language = Language.query.filter(Language.name == language_name).first()
if language is None:
language = Language(id=language_name, name=language_name)
db.session.add(language)
profile_language = ProfileLanguage.query.filter(ProfileLanguage.profile == profile,
ProfileLanguage.language == language).first()