You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
695 B
21 lines
695 B
# coding=utf-8
|
|
import os
|
|
|
|
import datetime
|
|
import django
|
|
import sys
|
|
|
|
sys.path.append("/var/www/projects/lms/")
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.settings")
|
|
django.setup()
|
|
from access.models import User
|
|
from journals.models import TeacherJ
|
|
from courses.models import Course
|
|
|
|
for course in Course.objects.all():
|
|
for user in User.objects.all():
|
|
if user.date_joined.year == datetime.date.today().year and user.date_joined.year == datetime.date.today().month and user.date_joined.year == datetime.date.today().day:
|
|
journals = TeacherJ.objects.filter(student=user, course=course)
|
|
if journals.count() > 1:
|
|
journals.last().delete()
|
|
|
|
|