Merge branch 'hotfix/hotfix-and-some-changes' into 'develop'

Hotfix/hotfix and some changes

See merge request !23
remotes/origin/pm_task_31703
Zolotarev Alexander 9 years ago
commit fcdeb3d9e0
  1. 3
      _utils/check_course_journal.py
  2. 6
      courses/views.py
  3. 14
      journals/models.py
  4. 6
      lms/settings.py
  5. 1
      management/letters.py
  6. 2
      management/mails.py

@ -59,4 +59,5 @@ def check_course_journal(course_id):
if __name__ == "__main__":
course_id = sys.argv[1]
check_course_journal(course_id)
check_course_journal(course_id)

@ -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))

@ -433,12 +433,16 @@ class CourseThemeJ(models.Model):
self.success = True
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)

@ -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'

@ -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
}

@ -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

Loading…
Cancel
Save