From 9f939fe57c34619edc7bc5c99abba22e4ae30b90 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 27 Aug 2021 07:50:48 -0700 Subject: [PATCH] Fix missing None check --- amanuensis/server/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amanuensis/server/helpers.py b/amanuensis/server/helpers.py index c68c190..434dcb3 100644 --- a/amanuensis/server/helpers.py +++ b/amanuensis/server/helpers.py @@ -88,7 +88,7 @@ def editor_required(route): user: User = current_user lexicon: Lexicon = g.lexicon mem: Optional[Membership] = memq.try_from_ids(db, user.id, lexicon.id) - if not mem.is_editor: + if not mem or not mem.is_editor: flash("You must be the editor to view this page") return redirect(url_for('lexicon.contents', name=lexicon.name)) return route(*args, **kwargs)