diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-10-03 17:06:16 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-10-03 17:06:16 +0100 |
commit | 328d05bdf647effac1cdb444e36a0debb5d93a02 (patch) | |
tree | 0c508bc740e91709f493f8753cdf15d0ec4af992 /app/utils.py | |
parent | 2229b32c90fa9ea2b8312cb9367d6bae17649b4b (diff) | |
download | cheatdb-328d05bdf647effac1cdb444e36a0debb5d93a02.tar.xz |
Add option to hide non-free packages in API
Diffstat (limited to 'app/utils.py')
-rw-r--r-- | app/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/utils.py b/app/utils.py index dc65736..cb6a315 100644 --- a/app/utils.py +++ b/app/utils.py @@ -170,3 +170,13 @@ def clearNotifications(url): if current_user.is_authenticated: Notification.query.filter_by(user=current_user, url=url).delete() db.session.commit() + + +YESES = ["yes", "true", "1", "on"] + +def isYes(val): + return val and val.lower() in YESES + + +def isNo(val): + return val and not isYes(val) |