--- a/src/pyams_security/property.py Fri Jan 18 15:39:35 2019 +0100
+++ b/src/pyams_security/property.py Tue Jun 25 15:02:52 2019 +0200
@@ -29,10 +29,10 @@
def __init__(self, field, role_id=None, name=None, **args):
if not IField.providedBy(field):
raise ValueError("Provided field must implement IField interface")
- if (role_id is None) and not IRoleField.providedBy(field):
- raise ValueError("Provided field must implement IRoleField interface "
- "or you must provide a role ID")
if role_id is None:
+ if not IRoleField.providedBy(field):
+ raise ValueError("Provided field must implement IRoleField interface "
+ "or you must provide a role ID")
role_id = field.role_id
elif IRole.providedBy(role_id):
role_id = role_id.id