assign_credits event now creates a proper request object .
--- 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.
--- 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: