From ef22478a11d518982f38a6a0d4d84f6f8ba5e492 Mon Sep 17 00:00:00 2001 From: adityacp Date: Sun, 14 Jan 2018 16:20:58 +0530 Subject: Change in models.py, course.js and course_detail.html - Merge future imports in models into one - Add table sorter in course.js and course_detail.html --- yaksh/models.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 3b1e3ba..f0d1b2e 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1,5 +1,4 @@ -from __future__ import unicode_literals -from __future__ import division +from __future__ import unicode_literals, division from datetime import datetime, timedelta import json import random @@ -489,7 +488,7 @@ class LearningModule(models.Model): def get_module_complete_percent(self, course, user): units = self.get_learning_units() if not units: - percent = 0 + percent = 0.0 else: status_list = [unit.get_completion_status(user, course) for unit in units] @@ -700,7 +699,7 @@ class Course(models.Model): def percent_completed(self, user): modules = self.get_learning_modules() if not modules: - percent = 0 + percent = 0.0 else: status_list = [module.get_module_complete_percent(self, user) for module in modules] -- cgit