--- a/taskapp/events/task.py Thu Mar 04 15:56:25 2010 +0530
+++ b/taskapp/events/task.py Thu Mar 04 15:58:27 2010 +0530
@@ -148,7 +148,13 @@
claim.creation_datetime = datetime.now()
claim.save()
- user.request_sent_to.filter(is_replied=False, is_valid=True, role="MT", task=task).update(is_valid=False)
+ pending_reqs = user.request_sent_to.filter(is_replied=False, is_valid=True, role="MT", task=task).all()
+ for req in pending_reqs:
+ req.is_valid = False
+ req.save()
+ user_url = '<a href="/user/view/uid=%s">%s</a>'%(user.id, user.username)
+ reason = "User has claimed the task and hence cannot be a mentor and this request was made invalid."
+ create_notification("MT", req.sent_by, user, task=task, reply=False, remarks=reason, requested_by=req.sent_by)
def assignTask(task, added_user, assigned_by):
""" check for the status of task and assign it to the particular user """
--- a/templates/user/view_request.html Thu Mar 04 15:56:25 2010 +0530
+++ b/templates/user/view_request.html Thu Mar 04 15:58:27 2010 +0530
@@ -19,7 +19,7 @@
<a href="/user/view/uid={{to_user.id}}">{{to_user.username}}</a>
{% endfor %}
<br />
- sent on {{notification.sent_date|date:"D d M Y"}} at {{notification.sent_date|time:"H:i"}}<br />
+ sent on {{req.sent_date|date:"D d M Y"}} at {{req.sent_date|time:"H:i"}}<br />
Message: <br />
{% ifequal "PY" req.role %}
<a href="/user/view/uid={{req.sent_by.id}}">{{req.sent_by.username}}</a> assigned {{req.pynts}} pynts to