#248 [frontend] fix filter has no len() error
Merged 6 years ago by clime. Opened 6 years ago by frostyx.
copr/ frostyx/copr modularity-form-fix  into  master

@@ -958,7 +958,7 @@ 

              return False

  

          # Profile names should be unique

-         names = filter(None, self.profile_names.data)

+         names = [x for x in self.profile_names.data if x]

          if len(set(names)) < len(names):

              self.errors["profiles"] = ["Profile names must be unique"]

              return False

I've found one more python3 related thing. Building modules via web UI fails with

Error 500 : Internal Server Error
object of type 'filter' has no len()

That is because, in python2, the filter function returns list, but in python3 it returns an object of class filter.

@clime, can we please also hotfix this in production?

Pull-Request has been merged by clime

6 years ago
Metadata