diff options
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) |