Mercurial > p > roundup > code
changeset 8517:0e712d67a783
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.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 28 Jan 2026 15:21:02 -0500 |
| parents | 8c265e8bfc5a |
| children | 4b89c22b1a91 |
| files | doc/reference.txt |
| diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/reference.txt Tue Jan 27 22:17:17 2026 -0500 +++ b/doc/reference.txt Wed Jan 28 15:21:02 2026 -0500 @@ -1820,15 +1820,15 @@ ``issue`` class and the ``user`` class include a reference to an ``organization`` class. Users are permitted to view only those issues that are associated with their respective organizations. A - check function or this could look like:: + check function for this could look like:: def view_issue(db, userid, itemid): user = db.user.getnode(userid) if not user.organisation: return False issue = db.issue.getnode(itemid) - if user.organisation == issue.organisation: - return True + return user.organisation == issue.organisation + The corresponding ``filter`` function::
