🐛 Fix uploading a language pack

In Python 3, `filter()` returns an iterable rather than a list. Whilst this is better for performance, our list is not long and it means we can call `len()` on the list.

Tested using reproduction steps in #3814 and verified that language packs can now be installed properly.

Closes #3814
This commit is contained in:
cp2004 authored and Gina Häußge committed 2020-11-16 14:03:18 +01:00
1 parent 75796dafbc
commit ab5d19bf12
1 file changed
+4 -2
+4 -2
View File
@@ -140,8 +140,10 @@ def uploadLanguagePack():
upload_name = request.values[input_upload_name]
upload_path = request.values[input_upload_path]
exts = filter(
lambda x: upload_name.lower().endswith(x), (".zip", ".tar.gz", ".tgz", ".tar")
exts = list(
filter(
lambda x: upload_name.lower().endswith(x), (".zip", ".tar.gz", ".tgz", ".tar")
)
)
if not len(exts):
return make_response(