From 92bfcbe5cfb02c7f339b37d30c6842d859ad1729 Mon Sep 17 00:00:00 2001 From: Mikhail Bortnikov Date: Tue, 16 May 2017 15:46:19 +0300 Subject: [PATCH 1/4] delete sending file with new bill letter --- management/letters.py | 1 - management/mails.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/management/letters.py b/management/letters.py index 379d8e3..7006cbf 100755 --- a/management/letters.py +++ b/management/letters.py @@ -248,7 +248,6 @@ def sent_new_bill(bill): 'SERVICE': bill.get_name(), 'MANAGER': bill.manager.get_full_name(), 'MANAGER_EMAIL': bill.manager.get_email(), - 'FILE': None, #TODO: bill.service.course.get_description_file, 'DOMAIN': DOMAIN, 'NAME': NAME } diff --git a/management/mails.py b/management/mails.py index a95b031..4f18001 100755 --- a/management/mails.py +++ b/management/mails.py @@ -13,6 +13,6 @@ def letter_decor(): _type=data['type'], template=data['template'] if data.get('template') else '', result=data['result'] if data.get('result') else None, - file=data['file']) + ) return _render_json return wrap_response From aa42dedc57bf5f469896d055d8ee6cbb6dad86b6 Mon Sep 17 00:00:00 2001 From: Mikhail Bortnikov Date: Tue, 16 May 2017 17:16:03 +0300 Subject: [PATCH 2/4] set_open for theme now work --- journals/models.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/journals/models.py b/journals/models.py index 27e9705..b780beb 100755 --- a/journals/models.py +++ b/journals/models.py @@ -421,12 +421,16 @@ class CourseThemeJ(models.Model): self.actual_lesson = Lesson.objects.get(id=self.make_actual_lesson()) if self.set_open: - if self.material._type != 'Ex' and self.actual_lesson and not self.parent.opens.filter( - id=CourseMap.objects.get(token=self.actual_lesson.token).id).exists(): - set_opened(self.parent, self.actual_lesson.token) + if Lesson.objects.filter(theme=self.material).order_by('sort').exists(): + lesson = Lesson.objects.filter(theme=self.material).order_by('sort')[0] + else: + lesson = CourseMap.objects.filter(course=self.material.course).order_by('-sort')[0] + + if self.material._type != 'Ex' and not self.parent.opens.filter(token=lesson.token).exists(): + self.parent.opens.add(CourseMap.objects.get(token=lesson.token)) + set_opened(self.parent, lesson.token) - elif self.material._type == 'Ex' and not self.parent.opens.filter( - id=CourseMap.objects.get(token=Exam.objects.get(theme=self.material).token).id).exists(): + elif self.material._type == 'Ex' and not self.parent.opens.filter(id=CourseMap.objects.get(token=Exam.objects.get(theme=self.material).token).id).exists(): set_opened(self.parent, Exam.objects.get(theme=self.material).token) super(CourseThemeJ, self).save(*args, **kwargs) From c26ddb2bb4ad30767c80744d7845e95ddf64cc7c Mon Sep 17 00:00:00 2001 From: Mikhail Bortnikov Date: Thu, 1 Jun 2017 12:21:07 +0300 Subject: [PATCH 3/4] dont chech homework when enter course page --- _utils/check_course_journal.py | 3 ++- courses/views.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/_utils/check_course_journal.py b/_utils/check_course_journal.py index e701d2c..a82cc7b 100644 --- a/_utils/check_course_journal.py +++ b/_utils/check_course_journal.py @@ -59,4 +59,5 @@ def check_course_journal(course_id): if __name__ == "__main__": course_id = sys.argv[1] - check_course_journal(course_id) \ No newline at end of file + check_course_journal(course_id) + diff --git a/courses/views.py b/courses/views.py index 19494fa..e34e266 100755 --- a/courses/views.py +++ b/courses/views.py @@ -45,9 +45,9 @@ def course(request, slug): if created: check_journal(journal) _map = CourseMap.objects.filter(course=course).order_by('sort').first() - _j = _map.get_obj() - j = HomeworkJ.objects.get(material=_j, student=request.user) - j.open_material() + #_j = _map.get_obj() + #j = HomeworkJ.objects.get(material=_j, student=request.user) + #j.open_material() else: journal, created = TeacherJ.objects.get_or_create(course=course, student=user_fabric(request.user)) From dd826dcad1f9389a65ebf2d39d81e2f4aaf410f0 Mon Sep 17 00:00:00 2001 From: Mikhail Bortnikov Date: Thu, 1 Jun 2017 12:24:08 +0300 Subject: [PATCH 4/4] mail server now is gmail --- lms/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/settings.py b/lms/settings.py index a39fb90..6129997 100644 --- a/lms/settings.py +++ b/lms/settings.py @@ -56,12 +56,12 @@ BILL_TOKEN = u'c63fc7fdc74de318e1f9b078b6d4406a3e62f522b00fb305afe61c0ead238eb9c AMO_USER_LOGIN = 'baryshnikov@mokselle.com' AMO_USER_HASH = 'd639c26c1c1900e5a8cee66cd3395bdc' AMO_SUBDOMAIN = 'mokselle' -EMAIL_HOST = 'smtp.yandex.ru' +EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_PASSWORD = 'nu5Xefise' -EMAIL_HOST_USER = 'robo@skill-box.ru' +EMAIL_HOST_USER = 'robo@skillbox.ru' EMAIL_PORT = '587' EMAIL_USE_TLS = True -DEFAULT_FROM_EMAIL = 'robo@skill-box.ru' +DEFAULT_FROM_EMAIL = 'robo@skillbox.ru' YANDEX_MONEY_SHOP_PASSWORD = 'nu5Xefise' YANDEX_SHOP_ID = '84348' YANDEX_scid = '78309'