Merge branch 'master' of https://gitlab.com/lilcity/backend into feature/lil-583

remotes/origin/hotfix/LIL-691
gzbender 7 years ago
commit 1057238acf
  1. 2
      api/v1/views.py
  2. 8
      apps/payment/models.py
  3. 4
      apps/payment/views.py
  4. 2
      apps/school/templates/blocks/open_lesson.html
  5. 2
      apps/school/templates/school/summer_school.html

@ -72,7 +72,7 @@ User = get_user_model()
class AuthorBalanceViewSet(ExtendedModelViewSet):
queryset = AuthorBalance.objects.filter(
author__role__in=[User.AUTHOR_ROLE, User.ADMIN_ROLE],
author__role__in=[User.AUTHOR_ROLE, User.ADMIN_ROLE, User.TEACHER_ROLE],
)
serializer_class = AuthorBalanceCreateSerializer
serializer_class_map = {

@ -205,13 +205,14 @@ class Payment(PolymorphicModel):
]
def save(self, *args, **kwargs):
paid = self.status in [Pingback.PINGBACK_TYPE_REGULAR, Pingback.PINGBACK_TYPE_GOODWILL,
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,]
amount_data = Payment.calc_amount(payment=self)
self.amount = amount_data.get('amount')
if self.status is None:
self.amount = amount_data.get('amount')
if isinstance(self, SchoolPayment):
self.weekdays = amount_data.get('weekdays')
super().save(*args, **kwargs)
paid = self.status in [Pingback.PINGBACK_TYPE_REGULAR, Pingback.PINGBACK_TYPE_GOODWILL,
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,]
if isinstance(self, CoursePayment):
author_balance = getattr(self, 'authorbalance', None)
if not author_balance and paid:
@ -240,7 +241,6 @@ class CoursePayment(Payment):
verbose_name_plural = 'Платежи за курсы'
class SchoolPayment(Payment):
weekdays = ArrayField(models.IntegerField(), size=7, verbose_name='Дни недели')
add_days = models.BooleanField('Докупленные дни', default=False)

@ -1,3 +1,5 @@
from decimal import Decimal
import arrow
import json
import logging
@ -213,7 +215,7 @@ class PaymentwallCallbackView(View):
effective_amount = payment_raw_data.get('effective_price_amount')
if effective_amount:
payment.amount = effective_amount
payment.amount = Decimal(effective_amount)
transaction_to_mixpanel.delay(
payment.user.id,

@ -1,4 +1,4 @@
<a
class="timing__btn btn btn_light"
href="{% url 'school:lesson-detail' live_lesson.id %}"
>подробнее</a>
>смотреть урок</a>

@ -1,6 +1,6 @@
{% extends "templates/lilcity/index.html" %} {% load static %}
{% block title %}Онлайн-школа LilCity{% endblock title%}
{% block ogimage %}http://{{request.META.HTTP_HOST}}{% static 'img/og_summer_school.jpg' %}{% endblock %}
{% block ogimage %}http://{{request.META.HTTP_HOST}}{% static 'img/og_main.jpg' %}{% endblock %}
{% block content %}
{% if not is_purchased %}
{% include "../summer/promo.html" %}

Loading…
Cancel
Save