Merge branch 'master' of https://gitlab.com/lilcity/backend into feature/lil-583
commit
63a0a33cf8
16 changed files with 93 additions and 38 deletions
@ -0,0 +1,22 @@ |
||||
from decimal import Decimal |
||||
from django.core.management.base import BaseCommand |
||||
from django.db.models import F |
||||
|
||||
from apps.payment.models import Payment, AuthorBalance |
||||
|
||||
|
||||
class Command(BaseCommand): |
||||
help = 'Fix payment and author balance amount based on payment.data.effective_price_amount' |
||||
|
||||
def handle(self, *args, **options): |
||||
|
||||
for payment in Payment.objects.exclude(data__effective_price_amount=''): |
||||
if payment.data.get('effective_price_amount'): |
||||
payment.amount = Decimal(payment.data.get('effective_price_amount')) |
||||
payment.save() |
||||
|
||||
for ab in AuthorBalance.objects.exclude(payment__amount=F('amount')).select_related('payment'): |
||||
ab.amount = ab.payment.amount |
||||
ab.save() |
||||
|
||||
|
||||
@ -1,5 +1,6 @@ |
||||
<a |
||||
data-popup=".js-popup-buy" |
||||
class="timing__btn btn" |
||||
data-day="{{ school_schedule.weekday }}" |
||||
href="{% url 'school-checkout' %}?weekdays={{ school_schedule.weekday }}&add_days=true" |
||||
>купить</a> |
||||
|
||||
Loading…
Reference in new issue