Commit 20d6f95c authored by Vincent Pelletier's avatar Vincent Pelletier

Ignore "empty" role (base) categories.

Also excludes whitespace-only (base) categories & end of lines.
parent 2be2459c
...@@ -190,7 +190,7 @@ class LocalRoleAssignorMixIn(object): ...@@ -190,7 +190,7 @@ class LocalRoleAssignorMixIn(object):
elif k == 'id': elif k == 'id':
k, v = 'role_name', tuple(x.strip() for x in v.split(';')) k, v = 'role_name', tuple(x.strip() for x in v.split(';'))
elif k in ('base_category', 'category'): elif k in ('base_category', 'category'):
k, v = 'role_' + k, tuple(x.strip() for x in v) k, v = 'role_' + k, tuple(y for y in (x.strip() for x in v) if y)
elif k == 'base_category_script': elif k == 'base_category_script':
k = 'role_base_category_script_id' k = 'role_base_category_script_id'
setattr(role, k, v) setattr(role, k, v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment