aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-07-11 13:27:44 +0100
committerGravatar Gareth Coles <[email protected]>2018-07-11 13:27:44 +0100
commit5523fc205c64d9c0e0a92f9b822aac6514fe432b (patch)
tree8d089fc904c53dfe799cf8ce6b2e37645e5346a1
parentrobots.txt: I can code, I swear (diff)
parentDo not add lock to page if there is no content on it (diff)
Merge remote-tracking branch 'origin/master'
-rw-r--r--pysite/views/wiki/edit.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pysite/views/wiki/edit.py b/pysite/views/wiki/edit.py
index 65378807..407da62b 100644
--- a/pysite/views/wiki/edit.py
+++ b/pysite/views/wiki/edit.py
@@ -40,7 +40,10 @@ class EditView(RouteView, DBMixin, RMQMixin):
lock_expiry = datetime.datetime.utcnow() + datetime.timedelta(minutes=5)
- if not DEBUG_MODE: # If we are in debug mode we have no user logged in, therefore we can skip locking
+ # There are a couple of cases where we will not need to lock a page. One of these is if the application is
+ # current set to debug mode. The other of these cases is if the page is empty, because if the page is empty
+ # we will only have a partially filled out page if the user quits before saving.
+ if not DEBUG_MODE and obj.get("rst"):
self.db.insert(
self.table_name,
{