mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-10 01:50:59 +00:00
Neater test for types in content_state_equal
discussion: https://github.com/wagtail/wagtail/pull/4136#discussion_r162669531
This commit is contained in:
parent
7830fc499c
commit
f37a62ee46
1 changed files with 2 additions and 2 deletions
|
|
@ -12,14 +12,14 @@ def content_state_equal(v1, v2):
|
|||
if type(v1) != type(v2):
|
||||
return False
|
||||
|
||||
if type(v1) == dict:
|
||||
if isinstance(v1, dict):
|
||||
if set(v1.keys()) != set(v2.keys()):
|
||||
return False
|
||||
return all(
|
||||
k == 'key' or content_state_equal(v, v2[k])
|
||||
for k, v in v1.items()
|
||||
)
|
||||
elif type(v1) == list:
|
||||
elif isinstance(v1, list):
|
||||
if len(v1) != len(v2):
|
||||
return False
|
||||
return all(
|
||||
|
|
|
|||
Loading…
Reference in a new issue