Skip to content

Commit

Permalink
update_spawner_attributes, allow set non-existing attribute on spawne…
Browse files Browse the repository at this point in the history
…r object
  • Loading branch information
rasmunk committed May 24, 2019
1 parent 2463d2b commit 33983a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ldap_hooks/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ def update_spawner_attributes(spawner, spawner_attributes):
attr = getattr(spawner, spawner_attr)
if isinstance(attr, dict):
attr.update(spawner_value)
if isinstance(attr, list) or isinstance(attr, str):
if isinstance(attr, (list, set, tuple, str)):
setattr(spawner, spawner_attr, spawner_value)
else:
setattr(spawner, spawner_attr, spawner_value)


@gen.coroutine
Expand Down

0 comments on commit 33983a6

Please sign in to comment.