summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornishanth2010-02-05 16:05:54 +0530
committernishanth2010-02-05 16:05:54 +0530
commitd3e9b0e20c7ab78a4d31fca706459ea72c4ea0ec (patch)
treef10883fb6eef2dc169d96842cfcb6af5cdc45099
parent68aadc0ccab2fce65c3ade8fb495c375465c7e5e (diff)
downloadpytask-d3e9b0e20c7ab78a4d31fca706459ea72c4ea0ec.tar.gz
pytask-d3e9b0e20c7ab78a4d31fca706459ea72c4ea0ec.tar.bz2
pytask-d3e9b0e20c7ab78a4d31fca706459ea72c4ea0ec.zip
fixed a bug in templates/task/claim.html which required modification of views/task.py; also changed the no.of char limit on task title .
-rw-r--r--taskapp/models.py2
-rw-r--r--taskapp/models.pycbin4637 -> 0 bytes
-rw-r--r--taskapp/views/task.py8
-rw-r--r--templates/task/claim.html18
4 files changed, 19 insertions, 9 deletions
diff --git a/taskapp/models.py b/taskapp/models.py
index 986f65d..9d7f1ce 100644
--- a/taskapp/models.py
+++ b/taskapp/models.py
@@ -46,7 +46,7 @@ class Profile(models.Model):
class Task(models.Model):
- title = models.CharField(max_length = 200, unique = True)
+ title = models.CharField(max_length = 100, unique = True)
desc = models.TextField()
status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
tags = models.CharField(max_length = 200, blank = True)
diff --git a/taskapp/models.pyc b/taskapp/models.pyc
deleted file mode 100644
index ee07db6..0000000
--- a/taskapp/models.pyc
+++ /dev/null
Binary files differ
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index 0fbc6aa..c266f22 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -189,12 +189,14 @@ def claim_task(request, tid):
task_claimable = True if task.status in ["OP", "RE", "CL"] else False
user_can_claim = True if task_claimable and not ( is_guest or is_mentor ) and ( user not in task.claimed_users.all() ) else False
+ task_claimed = True if task.status == "CL" else False
context = {'is_mentor':is_mentor,
'task':task,
'claims':claims,
'user_can_claim':user_can_claim,
'task_claimable':task_claimable,
+ 'task_claimed':task_claimed,
'errors':errors}
if not is_guest:
@@ -239,8 +241,12 @@ def assign_task(request, tid):
return redirect(task_url)
else:
return render_to_response('task/assign.html',{'form':form})
- else:
+ elif task.status == "AS":
return show_msg('The task is already assigned', task_url, 'view the task')
+ elif task.status == "OP":
+ return show_msg('No one has still claimed the task', task_url, 'view the task')
+ else:
+ return show_msg('The task status is %s. how can you assign it now'%task.status, task_url, 'view the task')
else:
return show_msg('You are not authorised to perform this action', task_url, 'view the task')
diff --git a/templates/task/claim.html b/templates/task/claim.html
index e758f42..26eceef 100644
--- a/templates/task/claim.html
+++ b/templates/task/claim.html
@@ -1,12 +1,16 @@
{% extends 'base.html' %}
{% block content %}
- List of all the claims for the task <a href="/task/view/tid={{task.id}}">{{task.title}}</a><br />
- {% for claim in claims %}
- <hr />
- <a href="/user/view/uid={{claim.user.id}}">{{claim.user.username}}</a> at {{claim.creation_datetime.ctime}} wrote:<br />
- {{claim.message}}<br />
- {% endfor %}
- {% if task_claimable and is_mentor %}
+ {% if claims %}
+ List of all the claims for the task <a href="/task/view/tid={{task.id}}">{{task.title}}</a><br />
+ {% for claim in claims %}
+ <hr />
+ <a href="/user/view/uid={{claim.user.id}}">{{claim.user.username}}</a> at {{claim.creation_datetime.ctime}} wrote:<br />
+ {{claim.message}}<br />
+ {% endfor %}
+ {% else %}
+ There are no claims for task <a href="/task/view/tid={{task.id}}">{{task.title}}</a> yet.
+ {% endif %}
+ {% if task_claimed and is_mentor %}
<a href="/task/assign/tid={{task.id}}">Assign task</a>
{% endif %}
{% if user_can_claim %}