From 19263040a9f72d7617ef886fd57a1a46a97261bb Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 31 Jan 2020 14:02:08 -0800 Subject: [PATCH] Allow editor to edit any character In particular, this allows th editor to edit the default character --- amanuensis/server/lexicon.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/amanuensis/server/lexicon.py b/amanuensis/server/lexicon.py index 6e78815..18ab352 100644 --- a/amanuensis/server/lexicon.py +++ b/amanuensis/server/lexicon.py @@ -32,8 +32,6 @@ def get_bp(): # Gate on password if one is required if (g.lexicon.join.password and form.password.data != g.lexicon.join.password): - flash("Incorrect password") - print("redirecting") return redirect(url_for("lexicon.join", name=name)) # Gate on join validity if valid_add(g.lexicon, current_user, form.password.data): @@ -41,7 +39,7 @@ def get_bp(): return redirect(url_for("lexicon.session", name=name)) else: flash("Could not join game") - return redirect(url_for("lexicon.join", name=name)) + return redirect(url_for("home.home", name=name)) return render_template('lexicon/join.html', form=form) @@ -101,7 +99,8 @@ def get_bp(): if cid not in g.lexicon.character: flash('Character not found') return redirect(url_for('lexicon.session', name=name)) - if g.lexicon.character.get(cid).player != current_user.id: + if (g.lexicon.character.get(cid).player != current_user.id + and g.lexicon.editor != current_user.id): flash('Access denied') return redirect(url_for('lexicon.session', name=name)) return edit_character(name, form, cid)