summaryrefslogtreecommitdiff
path: root/taskapp/views
diff options
context:
space:
mode:
Diffstat (limited to 'taskapp/views')
-rw-r--r--taskapp/views/task.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index df56a1c..0cbc3c9 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -241,11 +241,14 @@ def assign_task(request, tid):
is_guest = True if not user.is_authenticated() else False
is_mentor = True if user in task.mentors.all() else False
- task_claimed = True if task.status == "CL" else False
+ claimed_users = task.claimed_users.all()
+ assigned_users = task.assigned_users.all()
+
+ task_claimed = True if claimed_users else False
if (not is_guest) and is_mentor:
if task_claimed:
- user_list = ((user.id,user.username) for user in task.claimed_users.all())
+ user_list = ((user.id,user.username) for user in claimed_users)
form = AssignTaskForm(user_list)
if request.method == "POST":
@@ -255,12 +258,10 @@ def assign_task(request, tid):
return redirect(task_url)
else:
return render_to_response('task/assign.html',{'form':form})
- 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')
+ elif assigned_users:
+ return show_msg('When the no of users you need for the task is more than the no of users willing to do the task, I\'d say please re consider the task :P',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')
+ return show_msg('Wait for ppl to claim dude... slow and steady wins the race :)', task_url, 'view the task')
else:
return show_msg('You are not authorised to perform this action', task_url, 'view the task')