Stats are updated correctly when a project is unpublished
authorverrierj
Wed, 01 Feb 2012 15:29:34 +0100
changeset 498 39a7b09be44f
parent 497 499eca233839
child 500 10ec59f06198
child 503 4be5eba42451
Stats are updated correctly when a project is unpublished
src/ldt/ldt/ldt_utils/stat.py
--- a/src/ldt/ldt/ldt_utils/stat.py	Wed Feb 01 14:34:43 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/stat.py	Wed Feb 01 15:29:34 2012 +0100
@@ -41,18 +41,16 @@
  
    
 def update_stat_project(project, contents_only=[]):
-        if project.state != 2:
-            return None
     
-        if contents_only:
-            contents = contents_only
-        else:
-            contents = project.contents.all()
+    if contents_only:
+        contents = contents_only
+    else:
+        contents = project.contents.all()
             
-        for c in contents:
-            update_stat_content(c)
+    for c in contents:
+        update_stat_content(c)
             
-        return True
+    return True
     
 
 def add_annotation_to_stat(content, begin, end, polemics=[]):