modified add_user and rem_user methods to also include the mentor who is doing it.
authornishanth
Sun, 28 Feb 2010 22:58:58 +0530
changeset 154 420f974328cc
parent 153 925af1b4ee65
child 155 52958289d81f
modified add_user and rem_user methods to also include the mentor who is doing it.
taskapp/events/task.py
taskapp/views/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.
     """
 
--- 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})