def ensure_permission_set_tree_cached(user):
if hasattr(user, CACHED_PSET_PROPERTY_KEY):<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>setattr(<EOL>user, CACHED_PSET_PROPERTY_KEY, _get_permission_set_tree(user))<EOL><DEDENT>except ObjectDoesNotExist:  <EOL><INDENT>pass<EOL><DEDENT>
Helper to cache permission set tree on user instance