From 7c80a05cedd837ebb279091b4d9bb426c274957f Mon Sep 17 00:00:00 2001
From: nishanth
Date: Thu, 4 Mar 2010 14:50:24 +0530
Subject: if a user claims a task his unreplied mentor requests will be made
invalid.
---
taskapp/events/task.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/taskapp/events/task.py b/taskapp/events/task.py
index 19e84b2..0a077ce 100644
--- a/taskapp/events/task.py
+++ b/taskapp/events/task.py
@@ -148,7 +148,13 @@ def addClaim(task, message, user):
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 = '%s'%(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 """
--
cgit
From ae3e80fb419756c040c786d7269f00db2739777c Mon Sep 17 00:00:00 2001
From: nishanth
Date: Thu, 4 Mar 2010 15:31:40 +0530
Subject: fixed the time display bug in view_request template.
---
templates/user/view_request.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/user/view_request.html b/templates/user/view_request.html
index cb803fb..4a896bf 100644
--- a/templates/user/view_request.html
+++ b/templates/user/view_request.html
@@ -19,7 +19,7 @@
{{to_user.username}}
{% endfor %}
- sent on {{notification.sent_date|date:"D d M Y"}} at {{notification.sent_date|time:"H:i"}}
+ sent on {{req.sent_date|date:"D d M Y"}} at {{req.sent_date|time:"H:i"}}
Message:
{% ifequal "PY" req.role %}
{{req.sent_by.username}} assigned {{req.pynts}} pynts to
--
cgit