Merge branch 'master' of https://gitlab.com/lilcity/backend into hotfix/LIL-645

remotes/origin/hotfix/LIL-691
gzbender 7 years ago
commit 00e3dbd8ba
  1. 2
      api/v1/views.py
  2. 10
      apps/payment/models.py
  3. 4
      apps/payment/views.py
  4. 2
      apps/school/templates/school/summer_school.html

@ -72,7 +72,7 @@ User = get_user_model()
class AuthorBalanceViewSet(ExtendedModelViewSet): class AuthorBalanceViewSet(ExtendedModelViewSet):
queryset = AuthorBalance.objects.filter( 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 = AuthorBalanceCreateSerializer
serializer_class_map = { serializer_class_map = {

@ -193,8 +193,9 @@ class CoursePayment(Payment):
verbose_name_plural = 'Платежи за курсы' verbose_name_plural = 'Платежи за курсы'
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
amount_data = Payment.calc_amount(course_payment=self) if self.status is None:
self.amount = amount_data.get('amount') amount_data = Payment.calc_amount(course_payment=self)
self.amount = amount_data.get('amount')
super().save(*args, **kwargs) super().save(*args, **kwargs)
author_balance = getattr(self, 'authorbalance', None) author_balance = getattr(self, 'authorbalance', None)
if not author_balance: if not author_balance:
@ -226,8 +227,9 @@ class SchoolPayment(Payment):
return days return days
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
amount_data = Payment.calc_amount(school_payment=self) if self.status is None:
self.amount = amount_data.get('amount') amount_data = Payment.calc_amount(school_payment=self)
self.amount = amount_data.get('amount')
super().save(*args, **kwargs) super().save(*args, **kwargs)
@property @property

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

@ -1,6 +1,6 @@
{% extends "templates/lilcity/index.html" %} {% load static %} {% extends "templates/lilcity/index.html" %} {% load static %}
{% block title %}Онлайн-школа LilCity{% endblock title%} {% 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 %} {% block content %}
{% if not is_purchased %} {% if not is_purchased %}
{% include "../summer/promo.html" %} {% include "../summer/promo.html" %}

Loading…
Cancel
Save