summaryrefslogtreecommitdiff
path: root/taskapp
diff options
context:
space:
mode:
authornishanth2010-03-02 02:25:28 +0530
committernishanth2010-03-02 02:25:28 +0530
commitc96afacd4dd27cbf092eb398862ac9dc120e9309 (patch)
tree4f34b6b0463e240c8442287c0b56409f3cb1739e /taskapp
parentca946289e5f0b54483839c8a3671096774877827 (diff)
downloadpytask-c96afacd4dd27cbf092eb398862ac9dc120e9309.tar.gz
pytask-c96afacd4dd27cbf092eb398862ac9dc120e9309.tar.bz2
pytask-c96afacd4dd27cbf092eb398862ac9dc120e9309.zip
now task can have a title of a deleted task.
Diffstat (limited to 'taskapp')
-rw-r--r--taskapp/events/task.py2
-rw-r--r--taskapp/models.py2
-rw-r--r--taskapp/views/task.py7
3 files changed, 4 insertions, 7 deletions
diff --git a/taskapp/events/task.py b/taskapp/events/task.py
index 625c2d8..6fd3fef 100644
--- a/taskapp/events/task.py
+++ b/taskapp/events/task.py
@@ -119,7 +119,7 @@ def createTask(title,desc,created_by,credits):
break
try:
- task = Task.objects.get(title__iexact=title)
+ task = Task.objects.exclude(status="DL").get(title__iexact=title)
return None
except:
task = Task(title=title)
diff --git a/taskapp/models.py b/taskapp/models.py
index 4908756..9a58603 100644
--- a/taskapp/models.py
+++ b/taskapp/models.py
@@ -95,7 +95,7 @@ class Task(models.Model):
title = models.CharField(max_length = 100, verbose_name = u"Title", help_text = u"Keep it simple and below 100 chars.")
desc = models.TextField(verbose_name = u"Description")
status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
- tags_field = TagField()
+ tags_field = TagField() ## must be named some thing decent later on
credits = models.PositiveSmallIntegerField()
progress = models.PositiveSmallIntegerField(default = 0)
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index 17bbf3c..85041a0 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -132,7 +132,7 @@ def create_task(request):
title = data['title']
desc = data['desc']
credits = data['credits']
- publish = data['publish']
+ #publish = data['publish'] # just in case if we have to show the option
task = createTask(title,desc,user,credits)
if not task:
@@ -537,7 +537,7 @@ def edit_task(request, tid):
data = form.cleaned_data
title = data['title']
try:
- prev_task = Task.objects.get(title=title)
+ prev_task = Task.objects.exclude(status="DL").get(title=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})
@@ -556,9 +556,6 @@ def edit_task(request, tid):
else:
return show_msg(user, "You cannot edit the task at this stage", task_url, "view the task")
-
-
-
def complete_task(request, tid):
""" call the event called complete task.
and also pass it the current user to know who marked it as complete.