fix: only encode if type is not str

This commit is contained in:
prssanna 2020-03-31 16:23:12 +05:30
parent 5600d84d3c
commit d9f1a85d00

View file

@ -307,7 +307,7 @@ def has_controller_permissions(doc, ptype, user=None):
return None
def get_doctypes_with_read():
return list(set([p.parent.encode('UTF8') for p in get_valid_perms()]))
return list(set([p.parent if type(p.parent) == str else p.parent.encode('UTF8') for p in get_valid_perms()]))
def get_valid_perms(doctype=None, user=None):
'''Get valid permissions for the current user from DocPerm and Custom DocPerm'''