From 1bd079ae744e3f27d2cf3f157c9aa84709f26ecf Mon Sep 17 00:00:00 2001 From: Tanshu Date: Fri, 21 Jun 2013 15:12:01 +0530 Subject: [PATCH] Error where new thread could not be created because the check of old was wrong. --- brewman/brewman/views/messaging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brewman/brewman/views/messaging.py b/brewman/brewman/views/messaging.py index 8f382a5a..32ba4e7c 100644 --- a/brewman/brewman/views/messaging.py +++ b/brewman/brewman/views/messaging.py @@ -26,7 +26,7 @@ def save(request): user_id = uuid.UUID(authenticated_userid(request)) user_name = User.by_id(user_id).name title = request.json_body['Title'].strip() - if Thread.by_title(title) is None: + if Thread.by_title(title) is not None: raise ValidationError('Message with same title already exists') thread = Thread(title=title, priority=request.json_body['Priority'], user_id=user_id) DBSession.add(thread)