Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ref #1003 and #1025. Removes dups from reports psets and video listin…

…gs (for pset and video queries in general). Includes the template delete_content_section_form.html on the pset and video listing pages.
  • Loading branch information...
commit d01c4925df9872cc2a8d4693541ee23245cb9009 1 parent cfbc79c
@halawa halawa 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.