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
11ef91a2
Commit
11ef91a2
authored
May 14, 2020
by
Bruno Martin
Browse files
Merge branch 'develop'
parents
2dabc90d
236a6eee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
courses/models.py
courses/models.py
+2
-0
No files found.
courses/models.py
View file @
11ef91a2
...
...
@@ -359,6 +359,8 @@ class CourseStudent(models.Model):
def
get_current_class
(
self
):
try
:
return
Class
.
objects
.
get
(
students
=
self
.
user
,
course
=
self
.
course
)
except
Class
.
MultipleObjectsReturned
:
return
Class
.
objects
.
filter
(
students
=
self
.
user
,
course
=
self
.
course
).
first
()
except
Class
.
DoesNotExist
:
self
.
course
.
default_class
.
students
.
add
(
self
.
user
)
return
self
.
course
.
default_class
...
...
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