Exemplo n.º 1
0
    def save(self):
        package = self.cleaned_data["package"]
        start = self.cleaned_data["start"]
        amount = self.cleaned_data["amount"]
        balance = self.cleaned_data["balance"]

        radcheck = Radcheck.objects.get(username__exact=self.user.username)

        return save_subscription(radcheck, package, start, amount=amount, balance=balance, token=None)
Exemplo n.º 2
0
def create_subscription(request, package_pk):
    token = request.GET.get('token', None)

    package = Package.objects.get(pk=package_pk)
    radcheck = Radcheck.objects.get(username__exact=request.user.username)
    start = check_subscription(radcheck=radcheck)

    subscription = save_subscription(radcheck, package, start, amount=None, balance=None, token=token)

    messages.success(request, 'Package purchased successfully.')
    return redirect('packages:buy')
Exemplo n.º 3
0
    def save(self):
        package = self.cleaned_data['package']
        start = self.cleaned_data['start']
        amount = self.cleaned_data['amount']
        balance = self.cleaned_data['balance']

        radcheck = Radcheck.objects.get(username__exact=self.user.username)

        return save_subscription(radcheck,
                                 package,
                                 start,
                                 amount=amount,
                                 balance=balance,
                                 token=None)