rpsystem contrib: Made the recog/sdesc matching for normal objects also handle objects with multi-word keys or aliases

This commit is contained in:
Griatch 2016-06-04 13:12:08 +02:00
parent 674a475786
commit a79108583c

View file

@ -235,7 +235,7 @@ def regex_tuple_from_key_alias(obj):
(ordered_permutation_regex, obj, key/alias)
"""
return (re.compile(r"/%s|%s" % (obj.key, "|".join("/%s" % obj for obj in obj.aliases.all())), _RE_FLAGS),
return (re.compile(ordered_permutation_regex(" ".join([obj.key] + obj.aliases.all())), _RE_FLAGS),
obj,
obj.key)