# HG changeset patch # User nishanth # Date 1267100802 -19800 # Node ID 64c34c1f441fbfcf8af53a32523bdb26ed802ec2 # Parent cf94e35a9f99d8d83fadea2aeba1c6e397375e34 assign_credits event now creates a proper request object . diff -r cf94e35a9f99 -r 64c34c1f441f taskapp/events/task.py --- a/taskapp/events/task.py Thu Feb 25 17:37:14 2010 +0530 +++ b/taskapp/events/task.py Thu Feb 25 17:56:42 2010 +0530 @@ -1,5 +1,6 @@ from datetime import datetime from pytask.taskapp.models import Profile, Task, Comment, Credit, Claim, Map +from pytask.taskapp.utilities.request import create_request def publishTask(task): """ set the task status to open """ @@ -194,7 +195,7 @@ """ make a proper request object. """ - addCredits(task, given_by, given_to, points) + create_request(sent_by=given_by, role="PY", task=task, receiving_user=given_to, pynts=points ) def addCredits(task, given_by, given_to, points): """ add credit to the credits model. diff -r cf94e35a9f99 -r 64c34c1f441f taskapp/utilities/request.py --- a/taskapp/utilities/request.py Thu Feb 25 17:37:14 2010 +0530 +++ b/taskapp/utilities/request.py Thu Feb 25 17:56:42 2010 +0530 @@ -22,7 +22,7 @@ req.save() if role == 'PY': admin_profiles = Profile.objects.filter(rights='AD') - for admin in admin_profiles: + for admin_profile in admin_profiles: req.sent_to.add(admin_profile.user) req.receiving_user = receiving_user else: