aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-07 12:39:57 +0100
committerGravatar Gareth Coles <[email protected]>2018-05-07 12:39:57 +0100
commite3f18117dfc919677a9968984306d070aa3bef9b (patch)
treed1b168901e3fadfd96c8016ed61431972e4c5098
parentUpdate the code jams info page (diff)
[Wiki] Fix an editor dumb: `not not`
Diffstat (limited to '')
-rw-r--r--pysite/views/wiki/edit.py2
-rw-r--r--templates/wiki/page_edit.html5
2 files changed, 4 insertions, 3 deletions
diff --git a/pysite/views/wiki/edit.py b/pysite/views/wiki/edit.py
index bb39ed2b..f5c8fd6a 100644
--- a/pysite/views/wiki/edit.py
+++ b/pysite/views/wiki/edit.py
@@ -61,7 +61,7 @@ class EditView(RouteView, DBMixin):
rst = request.form.get("rst")
title = request.form["title"]
- if not rst or not not rst.strip():
+ if not rst or not rst.strip():
raise BadRequest()
if not title or not title.strip():
diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html
index 138292f9..34b59dca 100644
--- a/templates/wiki/page_edit.html
+++ b/templates/wiki/page_edit.html
@@ -37,7 +37,7 @@
let csrf_token = "{{ csrf_token() }}";
- function do_preview() {
+ function do_preview(_) {
let oReq = new XMLHttpRequest();
oReq.addEventListener("load", function() {
@@ -90,6 +90,7 @@
editor.setShowPrintMargin(false);
editor.on("input", function() {
+ document.getElementById("submit").disabled = true;
document.getElementById("rst").value = editor.getValue();
if (timer !== undefined) {
@@ -113,7 +114,7 @@
timer = setTimeout(do_preview, 1000);
};
- function refreshLock(){
+ function refreshLock() {
console.log("Refreshing lock");
let xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {