diff options
| author | 2018-07-10 23:18:22 +0100 | |
|---|---|---|
| committer | 2018-07-10 23:18:22 +0100 | |
| commit | 7ff3b8116bcf9afaeb637efe606dc825bd23dbc0 (patch) | |
| tree | 9219eb6a65abe4ff0607de9b3f9fed7794ebc48d /pysite/views/wiki | |
| parent | Fix robots.txt template (diff) | |
Do not add lock to page if there is no content on it
Diffstat (limited to 'pysite/views/wiki')
| -rw-r--r-- | pysite/views/wiki/edit.py | 5 | 
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,                  { | 
