Use the right name for the profile role's values.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Mon, 17 Jan 2011 05:33:27 +0530
changeset 442 7e6da295b90a
parent 441 10f16121a46b
child 443 a13ea00c1a3f
Use the right name for the profile role's values.
pytask/views.py
--- a/pytask/views.py	Mon Jan 17 05:32:59 2011 +0530
+++ b/pytask/views.py	Mon Jan 17 05:33:27 2011 +0530
@@ -1,5 +1,8 @@
 from django.shortcuts import render_to_response
 
+from pytask.profile import models as profile_models
+
+
 def show_msg(user, message, redirect_url=None, url_desc=None):
     """ simply redirect to homepage """
 
@@ -23,7 +26,7 @@
     selected_tasks = user.selected_tasks.all()
     reviewing_tasks = user.reviewing_tasks.all()
     unpublished_tasks = user.created_tasks.filter(status="UP").all()
-    can_create_task = True if profile.rights != "CT" else False
+    can_create_task = True if profile.role != profile_models.ROLES_CHOICES[3][0] else False
 
     context = {"user": user,
                "profile": profile,