Commit d9d182b6 authored by Fernando Ribeiro's avatar Fernando Ribeiro
Browse files

Fix: Change all occurrences of 'coursestudent_set' to 'course_students'

parent 2db36364
......@@ -196,10 +196,10 @@ class Course(models.Model):
def avg_lessons_users_progress(self, classes=None):
if classes:
student_enrolled = self.coursestudent_set.filter(
student_enrolled = self.course_students.filter(
user__classes__in=classes).count()
else:
student_enrolled = self.coursestudent_set.all().count()
student_enrolled = self.course_students.all().count()
progress_list = []
for lesson in self.lessons.all():
lesson_progress = {}
......
......@@ -43,7 +43,7 @@ class UserInDetailSerializer(serializers.ModelSerializer):
# 'has_certificate': x.certificate.type == 'certificate',
'has_certificate': False,
'class_name': x.get_current_class().name
} for x in obj.coursestudent_set.all()]
} for x in obj.course_students.all()]
return needed_stuff
def get_topics_created(self, obj):
......
......@@ -212,7 +212,7 @@ class UsersByGroupViewSet(PandasViewSet):
if groups is not None:
self.queryset = self.queryset.filter(groups__name__in=groups.split(','))
self.queryset = self.queryset.prefetch_related('groups', 'coursestudent_set')
self.queryset = self.queryset.prefetch_related('groups', 'course_students')
return self.queryset
......
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