Permalink
Browse files

Merge pull request #1026 from Stanford-Online/halawa_sprint15_fixes

Fixes for report dup and delete section from video and pset listing pages
  • Loading branch information...
2 parents 8f02543 + e872d9b commit 238c2253c0364bae19a4a4a25df8685849c59e0f @dcadams dcadams committed Oct 9, 2012
View
@@ -327,10 +327,10 @@ def getByCourseAndMenuSlug(self, course, menu_slug):
def getSectionPagesByCourse(self, course):
# Additional pages displayed under sections have a live_datetime effect.
if course.mode == 'draft':
- return self.filter(course=course,is_deleted=0,menu_slug=None).order_by('section','index')
+ return self.filter(course=course,is_deleted=0, section__is_deleted=0, menu_slug=None).order_by('section','index')
else:
now = datetime.now()
- return self.filter(course=course,is_deleted=0,menu_slug=None,live_datetime__lt=now).order_by('section','index')
+ return self.filter(course=course,is_deleted=0, section__is_deleted=0,menu_slug=None,live_datetime__lt=now).order_by('section','index')
def getBySection(self, section):
if section.mode == 'draft':
@@ -581,10 +581,10 @@ def create_user_profile(sender, instance, created, raw, **kwargs):
class VideoManager(models.Manager):
def getByCourse(self, course):
if course.mode == 'draft':
- return self.filter(course=course,is_deleted=0).order_by('section','index')
+ return self.filter(course=course,is_deleted=0, section__is_deleted=0).order_by('section','index')
else:
now = datetime.now()
- return self.filter(course=course,is_deleted=0,live_datetime__lt=now).order_by('section','index')
+ return self.filter(course=course,is_deleted=0, section__is_deleted=0, live_datetime__lt=now).order_by('section','index')
def getBySection(self, section):
if section.mode == 'draft':
@@ -834,10 +834,10 @@ class Meta:
class ProblemSetManager(models.Manager):
def getByCourse(self, course):
if course.mode == 'draft':
- return self.filter(course=course,is_deleted=0).order_by('section','index')
+ return self.filter(course=course,is_deleted=0, section__is_deleted=0).order_by('section','index')
else:
now = datetime.now()
- return self.filter(course=course,is_deleted=0,live_datetime__lt=now).order_by('section','index')
+ return self.filter(course=course,is_deleted=0, section__is_deleted=0,live_datetime__lt=now).order_by('section','index')
def getBySection(self, section):
if section.mode == 'draft':
@@ -117,3 +117,4 @@
</div>
{% include "problemsets/draft/delete_problem_set_form.html" %}
+{% include "content_sections/draft/delete_content_section_form.html" %}
@@ -117,3 +117,4 @@
</div>
{% include "videos/draft/delete_video_form.html" %}
+{% include "content_sections/draft/delete_content_section_form.html" %}

0 comments on commit 238c225

Please sign in to comment.