Browse Source

Don't mute type errors on making items ACL aware

Rafał Pitoń 10 years ago
parent
commit
8a5af2759f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      misago/acl/api.py

+ 2 - 2
misago/acl/api.py

@@ -49,10 +49,10 @@ def add_acl(user, target):
     """
     Add valid ACL to target (iterable of objects or single object)
     """
-    try:
+    if hasattr(target, '__iter__'):
         for item in target:
             _add_acl_to_target(user, item)
-    except TypeError:
+    else:
         _add_acl_to_target(user, target)