summaryrefslogtreecommitdiff
path: root/taskapp/views
diff options
context:
space:
mode:
authornishanth2010-03-02 16:04:41 +0530
committernishanth2010-03-02 16:04:41 +0530
commit84ce5a608dbac2797d86de88c8331b173ade26c0 (patch)
tree04361f17ea4930f1715ad164507744a9a0996729 /taskapp/views
parent0039fc6e942ed11284c4dee82807955f2f43e75d (diff)
downloadpytask-84ce5a608dbac2797d86de88c8331b173ade26c0.tar.gz
pytask-84ce5a608dbac2797d86de88c8331b173ade26c0.tar.bz2
pytask-84ce5a608dbac2797d86de88c8331b173ade26c0.zip
now validation for task title is done in the forms.
Diffstat (limited to 'taskapp/views')
-rw-r--r--taskapp/views/task.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index 637fc62..0b0984b 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -139,10 +139,6 @@ def create_task(request):
#publish = data['publish'] # just in case if we have to show the option
task = createTask(title,desc,user,credits)
- if not task:
- error_msg = "Another task with the same title exists"
- return render_to_response('task/create.html',{'user':user, 'form':form, 'error_msg':error_msg})
-
addMentor(task, user)
updateTask(task,tags_field=data['tags_field'])
# if publish: publishTask(task)
@@ -541,7 +537,7 @@ def edit_task(request, tid):
data = form.cleaned_data
title = data['title']
try:
- prev_task = Task.objects.exclude(status="DL").get(title=title)
+ prev_task = Task.objects.exclude(status="DL").get(title__iexact=title)
if prev_task != task:
error_msg = "Another task exists with the same title"
return render_to_response('task/edittask.html',{'user':user, 'form':form, 'error_msg':error_msg})