diff options
author | nishanth | 2010-02-25 17:00:18 +0530 |
---|---|---|
committer | nishanth | 2010-02-25 17:00:18 +0530 |
commit | b85600400bfff4f467b20e71db9cd5936c2056d4 (patch) | |
tree | 508f5e54b280d090a02accb2c87372e42fd86ea1 /taskapp/views | |
parent | 20ef35279dcc5c1e5b9cfac5830739c9f7c221ef (diff) | |
download | pytask-b85600400bfff4f467b20e71db9cd5936c2056d4.tar.gz pytask-b85600400bfff4f467b20e71db9cd5936c2056d4.tar.bz2 pytask-b85600400bfff4f467b20e71db9cd5936c2056d4.zip |
added events addCredits and assignCredits and modified assign_credits view accordingly.
Diffstat (limited to 'taskapp/views')
-rw-r--r-- | taskapp/views/task.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py index b05a8f6..37831cc 100644 --- a/taskapp/views/task.py +++ b/taskapp/views/task.py @@ -5,7 +5,7 @@ from django.shortcuts import render_to_response, redirect from pytask.taskapp.models import User, Task, Comment, Claim, Credit from pytask.taskapp.forms.task import TaskCreateForm, AddMentorForm, AddTaskForm, ChoiceForm, AssignCreditForm, RemoveUserForm -from pytask.taskapp.events.task import createTask, addMentor, publishTask, addSubTask, addDep, addClaim, assignTask, getTask, updateTask, removeTask, removeUser +from pytask.taskapp.events.task import createTask, addMentor, publishTask, addSubTask, addDep, addClaim, assignTask, getTask, updateTask, removeTask, removeUser, assignCredits from pytask.taskapp.views.user import show_msg ## everywhere if there is no task, django should display 500 message.. but take care of that in sensitive views like add mentor and all @@ -408,6 +408,7 @@ def assign_credits(request, tid): context = { 'user':user, + 'task':task, 'prev_credits':prev_credits, 'form':form, } @@ -420,10 +421,7 @@ def assign_credits(request, tid): uid = data['user'] points = data['points'] given_to = User.objects.get(id=uid) - given_time = datetime.now() - creditobj = Credit(task=task, given_by=user, given_to=given_to,points=points,given_time=given_time) - ## remove the next line and add a request here - creditobj.save() + assignCredits(task=task, given_by=user, given_to=given_to, points=points) return redirect('/task/assigncredits/tid=%s'%task.id) else: context['form'] = form |