# HG changeset patch
# User nishanth
# Date 1267595382 -19800
# Node ID 3bfe70742aa8e5afad812948653aac48ceed46c6
# Parent 439e419b6c13dcd5417e342af132a4378f7f281e
now requested mentors can see unpublished task but not comment on it.
diff -r 439e419b6c13 -r 3bfe70742aa8 taskapp/views/task.py
--- a/taskapp/views/task.py Wed Mar 03 05:36:21 2010 +0530
+++ b/taskapp/views/task.py Wed Mar 03 11:19:42 2010 +0530
@@ -82,7 +82,9 @@
claimed_users = task.claimed_users.all()
- context['task_viewable'] = True if ( task.status != "UP" ) or is_mentor else False
+ task_viewable = True if ( task.status != "UP" ) or is_mentor or user.request_sent_to.filter(is_valid=True,is_replied=False,role="MT",task=task)else False
+ if not task_viewable:
+ return show_msg(user, "You are not authorised to view this task", "/task/browse/", "browse the tasks")
context['can_publish'] = True if task.status == "UP" and user == task.created_by else False
context['can_edit'] = True if task.status == "UP" and is_mentor else False
diff -r 439e419b6c13 -r 3bfe70742aa8 templates/task/addmentor.html
--- a/templates/task/addmentor.html Wed Mar 03 05:36:21 2010 +0530
+++ b/templates/task/addmentor.html Wed Mar 03 11:19:42 2010 +0530
@@ -3,9 +3,9 @@
Click here to return to the task.
Requesting a user to act as a mentor for the task sends him a request. If he accepts the request, he will also be the mentor for this task
{% ifequal task.status "UP" %}
- and can view/editlearn more the task. But only the creator of a task can publish the task.
+ and can view/editlearn more the task. But only the creator of a task can publish the task.
{% else %}
- and will have all the rightslearn more you posses over the task.
+ and will have all the rightslearn more you posses over the task.
{% endifequal %}
diff -r 439e419b6c13 -r 3bfe70742aa8 templates/task/view.html
--- a/templates/task/view.html Wed Mar 03 05:36:21 2010 +0530
+++ b/templates/task/view.html Wed Mar 03 11:19:42 2010 +0530
@@ -3,165 +3,170 @@
{{task.title}}
{% endblock %}
{% block content %}
- {% if task_viewable %}
-