no log: added some failsafe to language conversion process for erroneous db content (ie.: why do I have a path in language field?!? old stuff...).

pull/1439/head v0.9.6-beta.25
morpheus65535 4 years ago
parent de4ff35e05
commit bd0a2fe004

@ -367,14 +367,19 @@ class Languages(Resource):
code2 = language
elif len(language) == 3:
code2 = alpha2_from_alpha3(language)
else:
continue
if not any(x['code2'] == code2 for x in languages_dicts):
try:
languages_dicts.append({
'code2': code2,
'name': language_from_alpha2(code2),
# Compatibility: Use false temporarily
'enabled': False
})
except:
continue
return jsonify(sorted(languages_dicts, key=itemgetter('name')))
result = TableSettingsLanguages.select(TableSettingsLanguages.name,

Loading…
Cancel
Save