Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
a3bacc19
Commit
a3bacc19
authored
Dec 02, 2021
by
Matheus Miranda
Browse files
Remove useless methods
parent
b4ee57d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
26 deletions
+0
-26
courses/models.py
courses/models.py
+0
-26
No files found.
courses/models.py
View file @
a3bacc19
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment