Skip to content

Commit 4ac217f

Browse files
committed
doc: fix typo and error in check command
change or -> for In check command replace: if user.organisation == issue.organisation: return True with return user.organisation == issue.organisation which returns a real False (not just a falsy None) and is more pythonic than if X: return True, just return X if False is a valid value.
1 parent 34e7500 commit 4ac217f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/reference.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,15 +1820,15 @@ The ``addPermission`` method takes a four optional parameters:
18201820
``issue`` class and the ``user`` class include a reference to an
18211821
``organization`` class. Users are permitted to view only those
18221822
issues that are associated with their respective organizations. A
1823-
check function or this could look like::
1823+
check function for this could look like::
18241824

18251825
def view_issue(db, userid, itemid):
18261826
user = db.user.getnode(userid)
18271827
if not user.organisation:
18281828
return False
18291829
issue = db.issue.getnode(itemid)
1830-
if user.organisation == issue.organisation:
1831-
return True
1830+
return user.organisation == issue.organisation
1831+
18321832

18331833
The corresponding ``filter`` function::
18341834

0 commit comments

Comments
 (0)