Error where new thread could not be created because the check of old was wrong.
This commit is contained in:
parent
89e6f347cd
commit
1bd079ae74
|
@ -26,7 +26,7 @@ def save(request):
|
||||||
user_id = uuid.UUID(authenticated_userid(request))
|
user_id = uuid.UUID(authenticated_userid(request))
|
||||||
user_name = User.by_id(user_id).name
|
user_name = User.by_id(user_id).name
|
||||||
title = request.json_body['Title'].strip()
|
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')
|
raise ValidationError('Message with same title already exists')
|
||||||
thread = Thread(title=title, priority=request.json_body['Priority'], user_id=user_id)
|
thread = Thread(title=title, priority=request.json_body['Priority'], user_id=user_id)
|
||||||
DBSession.add(thread)
|
DBSession.add(thread)
|
||||||
|
|
Loading…
Reference in New Issue