pytask/taskapp/views.py
changeset 500 42516ec56822
parent 497 6386458d749b
child 501 b84d6a1d4603
--- a/pytask/taskapp/views.py	Thu Jan 20 17:44:02 2011 +0530
+++ b/pytask/taskapp/views.py	Thu Jan 20 17:45:39 2011 +0530
@@ -476,11 +476,19 @@
 
     context.update(csrf(request))
 
-    can_edit = True if user == textbook.created_by and textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0]\
-                       else False
+    if (user == textbook.created_by and
+      textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0]):
+        can_edit = True
+    else:
+        can_edit = False
+
 
-    can_approve = True if profile.role in [profile_models.ROLES_CHOICES[0][0], profile_models.ROLES_CHOICES[1][0]] and \
-                          textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0] else False
+    if (profile.role in [profile_models.ROLES_CHOICES[0][0],
+      profile_models.ROLES_CHOICES[1][0]] and
+      textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0]):
+        can_approve = True
+    else:
+        can_approve = False
 
     context.update({"can_edit": can_edit,
                     "can_approve": can_approve})