Commit a3bacc19 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Remove useless methods

parent b4ee57d8
......@@ -214,9 +214,6 @@ class Course(models.Model):
lessons.append(lesson)
return lessons
def last_public_lesson(self):
return published
def first_lesson(self):
if self.lessons.exists():
return self.lessons.all()[0]
......@@ -539,16 +536,6 @@ class CourseStudent(models.Model):
return None
#next_lesson = self.course.lessons.filter(
# position__gt=last_unit_done.unit.lesson.position,
# status='published').order_by(
# 'position').first()
#if next_lesson and next_lesson.first_unit():
# return next_lesson.units.order_by('position').first()
#else:
# return self.course.first_lesson().first_unit()
except StudentProgress.DoesNotExist:
first_lesson = self.course.first_lesson()
if first_lesson:
......@@ -973,19 +960,6 @@ class Lesson(PositionedModel):
lessons = list(self.course.public_lessons)
return len(lessons) > 0 and self == lessons[-1]
@property
def public_units(self):
units = []
for unit in self.units.all():
if unit.status == 'draft':
if unit.release_date and unit.release_date <= timezone.now():
unit.status = 'published'
unit.save()
units.append(lesson)
else:
units.append(unit)
return units
def __str__(self):
return self.name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment