remotes/origin/hotfix/LIL-691
gzbender 7 years ago
parent 1057238acf
commit 8d645159c7
  1. 4
      apps/payment/models.py
  2. 14
      apps/user/views.py
  3. 2
      project/settings.py

@ -213,9 +213,9 @@ class Payment(PolymorphicModel):
if isinstance(self, SchoolPayment):
self.weekdays = amount_data.get('weekdays')
super().save(*args, **kwargs)
if isinstance(self, CoursePayment):
if isinstance(self, CoursePayment) and paid:
author_balance = getattr(self, 'authorbalance', None)
if not author_balance and paid:
if not author_balance :
AuthorBalance.objects.create(
author=self.course.author,
amount=self.amount,

@ -5,19 +5,15 @@ from os.path import splitext
from datetime import timedelta
from paymentwall import Pingback
import short_url
from urllib.parse import urljoin
from django.conf import settings
from django.contrib.auth import login
from django.core.exceptions import ValidationError
from django.shortcuts import render, reverse, redirect
from django.shortcuts import reverse, redirect
from django.views import View
from django.views.generic import DetailView, UpdateView, TemplateView, FormView
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.hashers import check_password, make_password
from django.http import Http404
from django.contrib.auth.decorators import login_required
from django.db.models import F, Func
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
@ -308,7 +304,7 @@ class BonusHistoryView(TemplateView):
def get(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs)
context['bonuses'] = request.user.bonuses.all()
context['referrer_url'] = urljoin(settings.MAIN_HOST, '%s?referrer=%s' % (
reverse('index'), short_url.encode_url(request.user.id)
))
context['referrer_url'] = '%s%s?referrer=%s' % (
settings.MAIN_HOST, reverse('index'), short_url.encode_url(request.user.id)
)
return self.render_to_response(context)

@ -31,7 +31,7 @@ SECRET_KEY = os.getenv('SECRET_KEY', 'jelm*91lj(_-o20+6^a+bgv!4s6e_efry^#+f#=1ak
DEBUG = os.getenv('DEBUG', False)
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '*').split(',')
MAIN_HOST = 'lil.school'
MAIN_HOST = os.getenv('MAIN_HOST', 'lil.school')
# Application definition

Loading…
Cancel
Save