summaryrefslogtreecommitdiff
path: root/stats/views.py
diff options
context:
space:
mode:
authoradityacp2020-11-07 18:54:15 +0530
committeradityacp2020-11-07 18:54:15 +0530
commitd09ff51b6c957137e705fee73f1808c6333eed7f (patch)
treea6e01c49a980809b1de0255aef040703f8ccde5c /stats/views.py
parenteed832d8a67ab9c2cef874b43f73d14a48cd0c71 (diff)
downloadonline_test-d09ff51b6c957137e705fee73f1808c6333eed7f.tar.gz
online_test-d09ff51b6c957137e705fee73f1808c6333eed7f.tar.bz2
online_test-d09ff51b6c957137e705fee73f1808c6333eed7f.zip
Add additional model to store last access for lesson
Diffstat (limited to 'stats/views.py')
-rw-r--r--stats/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/stats/views.py b/stats/views.py
index 3bfe9c3..f7c028f 100644
--- a/stats/views.py
+++ b/stats/views.py
@@ -7,7 +7,7 @@ from django.core.paginator import Paginator
from django.http import Http404
# Local Imports
-from stats.models import TrackLesson
+from stats.models import TrackLesson, LessonLog
from yaksh.models import Course
from yaksh.decorators import email_verified
@@ -27,7 +27,9 @@ def add_tracker(request, tracker_id):
if current_time:
track.current_time = current_time
track.video_duration = video_duration
- track.last_access_time = timezone.now()
+ LessonLog.objects.create(
+ track_id=track.id, last_access_time=timezone.now()
+ )
track.save()
success = True
else: