From 2fa60828fa0e646da65605cfd7605436967f7cb3 Mon Sep 17 00:00:00 2001 From: James Turk Date: Wed, 7 Apr 2010 12:20:05 -0400 Subject: [PATCH] fix lock grab on releasing a non-existent lock --- CHANGELOG | 1 + TODO | 4 +--- markupwiki/models.py | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d84a9eb..db2a77d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ - addition of optional comment fields on edit - cache-based lock for writing - added MARKUPWIKI_ settings + - RSS for articles and wiki as a whole 0.1.0 ===== diff --git a/TODO b/TODO index f9ac1d0..d73a3cc 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,6 @@ * revert option * wikiword highlighting * detect broken wiki links +* tests * only store diffs? * anonymous edits? - -add options: - * MARKUPWIKI_WIKIWORD_RE diff --git a/markupwiki/models.py b/markupwiki/models.py index 29cdf35..98e71b7 100644 --- a/markupwiki/models.py +++ b/markupwiki/models.py @@ -68,7 +68,8 @@ class Article(models.Model): cache.delete(cache_key) return lock == user.id - cache.set(cache_key, user.id, WRITE_LOCK_SECONDS) + if not release: + cache.set(cache_key, user.id, WRITE_LOCK_SECONDS) return True class ArticleVersion(models.Model):