diff options
author | nishanth | 2010-02-28 22:58:58 +0530 |
---|---|---|
committer | nishanth | 2010-02-28 22:58:58 +0530 |
commit | 83a0349462fa2459cf45d3ad0d7b69a7b3a27730 (patch) | |
tree | f553e1b80cbb07a2647adec8d7a6adf286df3935 /taskapp | |
parent | 2e78ea670355735b7a717dcfd87f1690cacf6ef6 (diff) | |
download | pytask-83a0349462fa2459cf45d3ad0d7b69a7b3a27730.tar.gz pytask-83a0349462fa2459cf45d3ad0d7b69a7b3a27730.tar.bz2 pytask-83a0349462fa2459cf45d3ad0d7b69a7b3a27730.zip |
modified add_user and rem_user methods to also include the mentor who is doing it.
Diffstat (limited to 'taskapp')
-rw-r--r-- | taskapp/events/task.py | 4 | ||||
-rw-r--r-- | taskapp/views/task.py | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/taskapp/events/task.py b/taskapp/events/task.py index 0d214ef..2d5cadf 100644 --- a/taskapp/events/task.py +++ b/taskapp/events/task.py @@ -144,7 +144,7 @@ def addClaim(task, message, user): claim.creation_datetime = datetime.now() claim.save() -def assignTask(task, user): +def assignTask(task, user, assigned_by): """ check for the status of task and assign it to the particular user """ if task.status in ['OP', 'WR']: @@ -180,7 +180,7 @@ def removeTask(main_task, sub_task): mapobj.subs.remove(sub_task) mapobj.save() -def removeUser(main_task, rem_user): +def removeUser(main_task, rem_user, removed_by): """ right now, just remove the user from the list of assigned_users. """ diff --git a/taskapp/views/task.py b/taskapp/views/task.py index fb05bd5..b9889da 100644 --- a/taskapp/views/task.py +++ b/taskapp/views/task.py @@ -382,8 +382,7 @@ def rem_user(request, tid): data = form.cleaned_data uid = data['user'] rem_user = User.objects.get(id=uid) - removeUser(task, rem_user) - print data['reason'] + removeUser(task, rem_user, user) return redirect(task_url) else: context['form'] = form @@ -421,7 +420,7 @@ def assign_task(request, tid): if request.method == "POST": uid = request.POST['choice'] assigned_user = User.objects.get(id=uid) - assignTask(task, assigned_user) + assignTask(task, assigned_user, user) return redirect(task_url) else: return render_to_response('task/assign.html',{'form':form}) |