diff options
author | nishanth | 2010-03-02 15:03:48 +0530 |
---|---|---|
committer | nishanth | 2010-03-02 15:03:48 +0530 |
commit | f636310f42f4d714b9eee73b87643817567943b5 (patch) | |
tree | 442566ea86fdad9384b7203ac25559e51459b2aa /taskapp/views | |
parent | 9f65a5058db057dcf0a9c722610d184d664ad074 (diff) | |
download | pytask-f636310f42f4d714b9eee73b87643817567943b5.tar.gz pytask-f636310f42f4d714b9eee73b87643817567943b5.tar.bz2 pytask-f636310f42f4d714b9eee73b87643817567943b5.zip |
now empty comments will not be accepted.
Diffstat (limited to 'taskapp/views')
-rw-r--r-- | taskapp/views/task.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py index 4438401..071f69b 100644 --- a/taskapp/views/task.py +++ b/taskapp/views/task.py @@ -104,7 +104,10 @@ def view_task(request, tid): if request.method == 'POST': if not is_guest: - data = request.POST["data"] + data = request.POST.get("data", "").strip() + if not data: + context['error_msg'] = "Enter some message to comment" + return render_to_response('task/view.html', context) new_comment = Comment(task=task, data=data, created_by=user, creation_datetime=datetime.now()) new_comment.save() return redirect(task_url) |