Update of "reinitialize" button : Test if a content have a front_project before catching its id
authorrougeronj
Thu, 20 Sep 2012 12:35:15 +0200
changeset 790 015f40d64d43
parent 789 d92d032a6d78
child 791 12ba862f33fa
Update of "reinitialize" button : Test if a content have a front_project before catching its id
src/ldt/ldt/ldt_utils/views/project.py
--- a/src/ldt/ldt/ldt_utils/views/project.py	Wed Sep 19 18:16:19 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/views/project.py	Thu Sep 20 12:35:15 2012 +0200
@@ -103,11 +103,11 @@
     contents = project.contents.all()
     groups = request.user.groups.exclude(name=settings.PUBLIC_GROUP_NAME)
     member_list, admin_list = get_userlist_model(project, request.user)
+    display_reset= False
     
-    if contents[0].front_project.ldt_id == ldt_id:
-        display_reset = True
-    else:
-        display_reset= False
+    if contents[0].front_project != None:
+        if contents[0].front_project.ldt_id == ldt_id:
+            display_reset = True        
     
     if request.method == "POST" :
         submit_action = request.REQUEST.get("submit_button", False)