Merge pull request #514 from taigaio/issue/fix-emails
Fix TypeErrors: sequence item expected str instance, NoneType foundremotes/origin/logger
commit
60db3b53c3
|
@ -40,4 +40,12 @@ def verbose_name(obj_class, field_name):
|
||||||
|
|
||||||
@library.global_function
|
@library.global_function
|
||||||
def lists_diff(list1, list2):
|
def lists_diff(list1, list2):
|
||||||
return (list(set(list1) - set(list2)))
|
"""
|
||||||
|
Get the difference of two list and remove None values.
|
||||||
|
|
||||||
|
>>> list1 = ["a", None, "b", "c"]
|
||||||
|
>>> list2 = [None, "b", "d", "e"]
|
||||||
|
>>> list(filter(None.__ne__, set(list1) - set(list2)))
|
||||||
|
['c', 'a']
|
||||||
|
"""
|
||||||
|
return list(filter(None.__ne__, set(list1) - set(list2)))
|
||||||
|
|
Loading…
Reference in New Issue