Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 392c9eb96d14414dc4bcb022406f47c3afe347e4 2 parents 0376452 + dcd532e
@dcadams dcadams authored
View
12 main/c2g/models.py
@@ -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':
View
1  main/templates/problemsets/draft/problem_set_management_section.html
@@ -117,3 +117,4 @@
</div>
{% include "problemsets/draft/delete_problem_set_form.html" %}
+{% include "content_sections/draft/delete_content_section_form.html" %}
View
1  main/templates/videos/draft/video_management_section.html
@@ -117,3 +117,4 @@
</div>
{% include "videos/draft/delete_video_form.html" %}
+{% include "content_sections/draft/delete_content_section_form.html" %}
Please sign in to comment.
Something went wrong with that request. Please try again.