# HG changeset patch # User verrierj # Date 1328201020 -3600 # Node ID 1166fb6bc9b485ccdff04c9657c40bc884d1440c # Parent d1be4a4f66399165aa0d8d568d1198f6ace738a9# Parent 8fb2523b9c74b1d926a1df9f575fbb82cf315a49 Merge with 8fb2523b9c74b1d926a1df9f575fbb82cf315a49 diff -r 8fb2523b9c74 -r 1166fb6bc9b4 src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Thu Feb 02 17:00:28 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/models.py Thu Feb 02 17:43:40 2012 +0100 @@ -224,7 +224,10 @@ create_front_project = True if not self.nb_annotation: - self.nb_annotation = 0 + self.nb_annotation = 0 + if not self.stat_annotation: + self.stat_annotation = self.__list2str([0] * (settings.DIVISIONS_FOR_STAT_ANNOTATION + len(settings.SYNTAX.keys()))) + super(Content, self).save(*args, **kwargs) @@ -373,10 +376,10 @@ set_current_user(admin) self.front_project = Project.create_project(admin, 'front project : %s' % self.title, [self], cuttings=['chapitrage', 'contributions'] ) - self.front_project.publish(allow_write=True) + self.front_project.publish(allow_write=True) + self.save() set_current_user(old_user) - - self.save() + # Tag management def get_tags(self): diff -r 8fb2523b9c74 -r 1166fb6bc9b4 src/ldt/ldt/ldt_utils/views/content.py --- a/src/ldt/ldt/ldt_utils/views/content.py Thu Feb 02 17:00:28 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/views/content.py Thu Feb 02 17:43:40 2012 +0100 @@ -222,8 +222,8 @@ if media: cached_assign('view_media', everyone, media) else: - remove_perm('view_content', everyone, content) - remove_perm('view_media', everyone, media) + remove_perm('ldt_utils.view_content', everyone, content) + remove_perm('ldt_utils.view_media', everyone, media) assign_perm_to_obj(content, content_form.cleaned_data['read_list'], content_form.cleaned_data['write_list'], request.user) if media: assign_perm_to_obj(media, content_form.cleaned_data['read_list'], content_form.cleaned_data['write_list'], request.user) diff -r 8fb2523b9c74 -r 1166fb6bc9b4 src/ldt/ldt/security/command.py --- a/src/ldt/ldt/security/command.py Thu Feb 02 17:00:28 2012 +0100 +++ b/src/ldt/ldt/security/command.py Thu Feb 02 17:43:40 2012 +0100 @@ -28,8 +28,12 @@ total = list_model['Project'].objects.count() for proj in list_model['Project'].objects.all(): - assign('ldt_utils.change_project', proj.owner, proj) - assign('ldt_utils.view_project', proj.owner, proj) + + if proj.state == 2: + proj.publish() + else: + proj.unpublish() + if verbose: show_progress(i, total, "Assign permissions to projects", 40, writer) i += 1