# HG changeset patch # User nishanth # Date 1267378138 -19800 # Node ID 420f974328cc3f3a222683219195f5c7af51ab36 # Parent 925af1b4ee65e83daf6699c78149846941a727ca modified add_user and rem_user methods to also include the mentor who is doing it. diff -r 925af1b4ee65 -r 420f974328cc taskapp/events/task.py --- a/taskapp/events/task.py Sun Feb 28 22:49:05 2010 +0530 +++ b/taskapp/events/task.py Sun Feb 28 22:58:58 2010 +0530 @@ -144,7 +144,7 @@ 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 @@ 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 -r 925af1b4ee65 -r 420f974328cc taskapp/views/task.py --- a/taskapp/views/task.py Sun Feb 28 22:49:05 2010 +0530 +++ b/taskapp/views/task.py Sun Feb 28 22:58:58 2010 +0530 @@ -382,8 +382,7 @@ 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 @@ 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})