<h2>Merge two players below.</h2>
+% if len(request.session.peek_flash("failure")) > 0:
+<div class="row">
+ <div class="span6">
+ <div class="alert alert-error">
+ <button type="button" class="close" data-dismiss="alert">×</button>
+ ${request.session.pop_flash("failure")[0]}
+ </div>
+ </div>
+</div>
+% endif
+
+% if len(request.session.peek_flash("success")) > 0:
+<div class="row">
+ <div class="alert alert-success">
+ <button type="button" class="close" data-dismiss="alert">×</button>
+ ${request.session.pop_flash("success")[0]}
+ </div>
+</div>
+% endif
+
<div class="row">
<div class="span6">
<form style="margin-top:20px;" class="form-horizontal">
if request.params.has_key("csrf_token"):
# check the token to prevent request forgery
st = request.session.get_csrf_token()
- log.debug("Session token is %s" % st)
- log.debug("Request token is %s" % request.params.get('csrf_token'))
check_csrf_token(request)
if request.params.has_key("w_pid") and request.params.has_key("l_pid"):
s.commit()
+ request.session.flash(
+ "Successfully merged player %s into %s!" % (l_pid, w_pid),
+ "success")
+
except:
s.rollback()
+ request.session.flash(
+ "Could not merge player %s into %s." % (l_pid, w_pid),
+ "failure")
+
return {}